Cosmic Ray Report
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Add, occurrence: 0
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,4 +1,4 @@ -from .models import * +from .models import + from .exceptions import * from django.db.models import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmps2hjpq36/repo/fb_post/utils.py", line 1
E from .models import +
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Add, occurrence: 1
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,5 +1,5 @@ from .models import * -from .exceptions import * +from .exceptions import + from django.db.models import * from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp2u935d66/repo/fb_post/utils.py", line 2
E from .exceptions import +
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Add, occurrence: 2
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,6 +1,6 @@ from .models import * from .exceptions import * -from django.db.models import * +from django.db.models import + from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp1a9f8hkf/repo/fb_post/utils.py", line 3
E from django.db.models import +
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Add, occurrence: 3
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -2,7 +2,7 @@ from .exceptions import * from django.db.models import * -from django.db import * +from django.db import + from datetime import datetime #task 2
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp20zuyedj/repo/fb_post/utils.py", line 5
E from django.db import +
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.29s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Sub, occurrence: 0
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,4 +1,4 @@ -from .models import * +from .models import - from .exceptions import * from django.db.models import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp20zuyedj/repo/fb_post/utils.py", line 1
E from .models import -
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Sub, occurrence: 1
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,5 +1,5 @@ from .models import * -from .exceptions import * +from .exceptions import - from django.db.models import * from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp3drvcp0s/repo/fb_post/utils.py", line 2
E from .exceptions import -
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Sub, occurrence: 2
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,6 +1,6 @@ from .models import * from .exceptions import * -from django.db.models import * +from django.db.models import - from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmps2hjpq36/repo/fb_post/utils.py", line 3
E from django.db.models import -
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.29s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Sub, occurrence: 3
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -2,7 +2,7 @@ from .exceptions import * from django.db.models import * -from django.db import * +from django.db import - from datetime import datetime #task 2
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpr7l2basw/repo/fb_post/utils.py", line 5
E from django.db import -
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Div, occurrence: 0
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,4 +1,4 @@ -from .models import * +from .models import / from .exceptions import * from django.db.models import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp3drvcp0s/repo/fb_post/utils.py", line 1
E from .models import /
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Div, occurrence: 1
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,5 +1,5 @@ from .models import * -from .exceptions import * +from .exceptions import / from django.db.models import * from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp20zuyedj/repo/fb_post/utils.py", line 2
E from .exceptions import /
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Div, occurrence: 2
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,6 +1,6 @@ from .models import * from .exceptions import * -from django.db.models import * +from django.db.models import / from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp3drvcp0s/repo/fb_post/utils.py", line 3
E from django.db.models import /
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Div, occurrence: 3
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -2,7 +2,7 @@ from .exceptions import * from django.db.models import * -from django.db import * +from django.db import / from datetime import datetime #task 2
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp2u935d66/repo/fb_post/utils.py", line 5
E from django.db import /
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.29s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_FloorDiv, occurrence: 0
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,4 +1,4 @@ -from .models import * +from .models import // from .exceptions import * from django.db.models import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpdyrkz0jr/repo/fb_post/utils.py", line 1
E from .models import //
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.31s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_FloorDiv, occurrence: 1
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,5 +1,5 @@ from .models import * -from .exceptions import * +from .exceptions import // from django.db.models import * from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp1a9f8hkf/repo/fb_post/utils.py", line 2
E from .exceptions import //
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_FloorDiv, occurrence: 2
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,6 +1,6 @@ from .models import * from .exceptions import * -from django.db.models import * +from django.db.models import // from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpr7l2basw/repo/fb_post/utils.py", line 3
E from django.db.models import //
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.31s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_FloorDiv, occurrence: 3
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -2,7 +2,7 @@ from .exceptions import * from django.db.models import * -from django.db import * +from django.db import // from datetime import datetime #task 2
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmps2hjpq36/repo/fb_post/utils.py", line 5
E from django.db import //
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Mod, occurrence: 0
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,4 +1,4 @@ -from .models import * +from .models import % from .exceptions import * from django.db.models import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpx1jaj20f/repo/fb_post/utils.py", line 1
E from .models import %
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Mod, occurrence: 1
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,5 +1,5 @@ from .models import * -from .exceptions import * +from .exceptions import % from django.db.models import * from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp3drvcp0s/repo/fb_post/utils.py", line 2
E from .exceptions import %
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Mod, occurrence: 2
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,6 +1,6 @@ from .models import * from .exceptions import * -from django.db.models import * +from django.db.models import % from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp20zuyedj/repo/fb_post/utils.py", line 3
E from django.db.models import %
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.29s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Mod, occurrence: 3
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -2,7 +2,7 @@ from .exceptions import * from django.db.models import * -from django.db import * +from django.db import % from datetime import datetime #task 2
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp20zuyedj/repo/fb_post/utils.py", line 5
E from django.db import %
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Pow, occurrence: 0
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,4 +1,4 @@ -from .models import * +from .models import ** from .exceptions import * from django.db.models import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp2u935d66/repo/fb_post/utils.py", line 1
E from .models import **
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Pow, occurrence: 1
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,5 +1,5 @@ from .models import * -from .exceptions import * +from .exceptions import ** from django.db.models import * from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpdyrkz0jr/repo/fb_post/utils.py", line 2
E from .exceptions import **
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.31s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Pow, occurrence: 2
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,6 +1,6 @@ from .models import * from .exceptions import * -from django.db.models import * +from django.db.models import ** from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp2u935d66/repo/fb_post/utils.py", line 3
E from django.db.models import **
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_Pow, occurrence: 3
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -2,7 +2,7 @@ from .exceptions import * from django.db.models import * -from django.db import * +from django.db import ** from datetime import datetime #task 2
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpdyrkz0jr/repo/fb_post/utils.py", line 5
E from django.db import **
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_RShift, occurrence: 0
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,4 +1,4 @@ -from .models import * +from .models import >> from .exceptions import * from django.db.models import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmps2hjpq36/repo/fb_post/utils.py", line 1
E from .models import >>
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_RShift, occurrence: 1
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,5 +1,5 @@ from .models import * -from .exceptions import * +from .exceptions import >> from django.db.models import * from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpdyrkz0jr/repo/fb_post/utils.py", line 2
E from .exceptions import >>
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_RShift, occurrence: 2
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,6 +1,6 @@ from .models import * from .exceptions import * -from django.db.models import * +from django.db.models import >> from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp20zuyedj/repo/fb_post/utils.py", line 3
E from django.db.models import >>
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_RShift, occurrence: 3
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -2,7 +2,7 @@ from .exceptions import * from django.db.models import * -from django.db import * +from django.db import >> from datetime import datetime #task 2
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpx1jaj20f/repo/fb_post/utils.py", line 5
E from django.db import >>
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_LShift, occurrence: 0
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,4 +1,4 @@ -from .models import * +from .models import << from .exceptions import * from django.db.models import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpdyrkz0jr/repo/fb_post/utils.py", line 1
E from .models import <<
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.29s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_LShift, occurrence: 1
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,5 +1,5 @@ from .models import * -from .exceptions import * +from .exceptions import << from django.db.models import * from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp20zuyedj/repo/fb_post/utils.py", line 2
E from .exceptions import <<
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_LShift, occurrence: 2
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,6 +1,6 @@ from .models import * from .exceptions import * -from django.db.models import * +from django.db.models import << from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp3drvcp0s/repo/fb_post/utils.py", line 3
E from django.db.models import <<
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_LShift, occurrence: 3
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -2,7 +2,7 @@ from .exceptions import * from django.db.models import * -from django.db import * +from django.db import << from datetime import datetime #task 2
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp1a9f8hkf/repo/fb_post/utils.py", line 5
E from django.db import <<
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_BitOr, occurrence: 0
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,4 +1,4 @@ -from .models import * +from .models import | from .exceptions import * from django.db.models import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmps2hjpq36/repo/fb_post/utils.py", line 1
E from .models import |
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_BitOr, occurrence: 1
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,5 +1,5 @@ from .models import * -from .exceptions import * +from .exceptions import | from django.db.models import * from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpdyrkz0jr/repo/fb_post/utils.py", line 2
E from .exceptions import |
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.29s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_BitOr, occurrence: 2
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,6 +1,6 @@ from .models import * from .exceptions import * -from django.db.models import * +from django.db.models import | from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp2u935d66/repo/fb_post/utils.py", line 3
E from django.db.models import |
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_BitOr, occurrence: 3
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -2,7 +2,7 @@ from .exceptions import * from django.db.models import * -from django.db import * +from django.db import | from datetime import datetime #task 2
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp1a9f8hkf/repo/fb_post/utils.py", line 5
E from django.db import |
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.29s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_BitAnd, occurrence: 0
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,4 +1,4 @@ -from .models import * +from .models import & from .exceptions import * from django.db.models import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpr7l2basw/repo/fb_post/utils.py", line 1
E from .models import &
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.29s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_BitAnd, occurrence: 1
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,5 +1,5 @@ from .models import * -from .exceptions import * +from .exceptions import & from django.db.models import * from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp1a9f8hkf/repo/fb_post/utils.py", line 2
E from .exceptions import &
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_BitAnd, occurrence: 2
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,6 +1,6 @@ from .models import * from .exceptions import * -from django.db.models import * +from django.db.models import & from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpdyrkz0jr/repo/fb_post/utils.py", line 3
E from django.db.models import &
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_BitAnd, occurrence: 3
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -2,7 +2,7 @@ from .exceptions import * from django.db.models import * -from django.db import * +from django.db import & from datetime import datetime #task 2
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp3drvcp0s/repo/fb_post/utils.py", line 5
E from django.db import &
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.31s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_BitXor, occurrence: 0
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,4 +1,4 @@ -from .models import * +from .models import ^ from .exceptions import * from django.db.models import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmps2hjpq36/repo/fb_post/utils.py", line 1
E from .models import ^
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.29s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_BitXor, occurrence: 1
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,5 +1,5 @@ from .models import * -from .exceptions import * +from .exceptions import ^ from django.db.models import * from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp3drvcp0s/repo/fb_post/utils.py", line 2
E from .exceptions import ^
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_BitXor, occurrence: 2
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -1,6 +1,6 @@ from .models import * from .exceptions import * -from django.db.models import * +from django.db.models import ^ from django.db import *
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmps2hjpq36/repo/fb_post/utils.py", line 3
E from django.db.models import ^
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceBinaryOperator_Mul_BitXor, occurrence: 3
--- mutation diff --- --- afb_post/utils.py +++ bfb_post/utils.py @@ -2,7 +2,7 @@ from .exceptions import * from django.db.models import * -from django.db import * +from django.db import ^ from datetime import datetime #task 2
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmps2hjpq36/repo/fb_post/utils.py", line 5
E from django.db import ^
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_NotEq, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -67,7 +67,7 @@
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction !=reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .................FF............................ [100%]
=================================== FAILURES ===================================
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_post(user.id,post.id,"LIT")
#Assert
reaction_1=Reaction.objects.all()
> assert list(reaction_1)==[]
E assert [<Reaction: R...n object (1)>] == []
E Left contains one more item: <Reaction: Reaction object (1)>
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:229: AssertionError
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_post(user.id,post.id,"WOW")
#Assert
reaction_1=Reaction.objects.all()
> assert reaction_1[0].reaction=="WOW"
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:240:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
return self._result_cache[k]
if isinstance(k, slice):
qs = self._chain()
if k.start is not None:
start = int(k.start)
else:
start = None
if k.stop is not None:
stop = int(k.stop)
else:
stop = None
qs.query.set_limits(start, stop)
return list(qs)[::k.step] if k.step else qs
qs = self._chain()
qs.query.set_limits(k, k + 1)
qs._fetch_all()
> return qs._result_cache[0]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:314: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.735247) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.749463) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.810131) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.812064) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.826654) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.390915) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.846928) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.847807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.849434) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.854214) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.855381) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.857000) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.872387) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.891845) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.911502) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.391024) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.932302) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.932782) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.391045) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.025847) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.026429) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.117508) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.118063) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.137886) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.138413) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.157523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.158043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.391147) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.178572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.179198) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.179715) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.200071) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.200557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.201063) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.391193) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.222393) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.222900) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.223418) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.223934) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.228908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.229386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.235681) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.236169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.236646) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.242762) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.243235) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.248043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.257923) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.263134) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.263573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.270503) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.270932) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.280764) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.281188) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.290522) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.290974) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.391324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.391533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.391533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.391693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.391693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.391693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.391849) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.391849) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.391849) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.392011) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.392011) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
================== 2 failed, 45 passed, 67 warnings in 1.16s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_NotEq, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -90,7 +90,7 @@
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction !=reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................FF..................... [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_comment(user.id,comment.id,"LOVE")
#Assert
reaction_1=Reaction.objects.all()
> assert list(reaction_1)==[]
E assert [<Reaction: R...n object (1)>] == []
E Left contains one more item: <Reaction: Reaction object (1)>
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:303: AssertionError
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_comment(user.id,comment.id,"WOW")
#Assert
reaction_1=Reaction.objects.all()
> assert reaction_1[0].reaction=="WOW"
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:314:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
return self._result_cache[k]
if isinstance(k, slice):
qs = self._chain()
if k.start is not None:
start = int(k.start)
else:
start = None
if k.stop is not None:
stop = int(k.stop)
else:
stop = None
qs.query.set_limits(start, stop)
return list(qs)[::k.step] if k.step else qs
qs = self._chain()
qs.query.set_limits(k, k + 1)
qs._fetch_all()
> return qs._result_cache[0]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:314: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.193276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.208105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.268666) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.270616) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.284458) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.842343) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.303981) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.304810) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.306398) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.311812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.312941) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.314554) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.328338) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.347222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.365797) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.842456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.386149) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.386628) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.407078) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.407577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.842501) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.437367) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.437871) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.456590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.457082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.475721) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.476323) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.842585) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.496609) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.497091) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.497606) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.842611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.587546) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.588115) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.588671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.669733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.670316) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.670862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.671377) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.676336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.676811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.683146) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.683638) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.684125) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.690523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.691000) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.695946) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.705998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.711171) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.711578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.718342) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.718764) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.728584) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.729006) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.738112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.738551) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.842760) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.842975) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.842975) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.843134) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.843134) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.843134) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.843292) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.843292) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.843292) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.843449) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.843449) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
================== 2 failed, 45 passed, 67 warnings in 1.16s ===================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/ReplaceComparisonOperator_Eq_NotEq, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -115,7 +115,7 @@
if not post_1:
raise InvalidPostException
- if post_1[0].posted_by_id==user_id:
+ if post_1[0].posted_by_id !=user_id:
post_1[0].delete()
if not user_1:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.962170) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.975576) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.030145) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.032182) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.046281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.610344) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.064810) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.065634) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.067268) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.072845) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.074039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.075566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.088802) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.109543) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.127897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.610457) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.147724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.148142) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.169304) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.169846) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.610501) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.201063) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.201598) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.221488) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.222022) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.241585) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.242287) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.610578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.263518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.264028) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.264544) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.285438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.285953) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.286494) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.610627) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.307274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.307745) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.308256) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.308750) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.313484) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.313985) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.320015) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.320485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.320951) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.327044) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.327510) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.332116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.343577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.351133) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.351629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.358767) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.359264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.369579) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.370106) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.379649) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.380154) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.610753) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.610978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.610978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.611149) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.611149) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.611149) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.611320) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.611320) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.611320) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.611493) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.611493) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.03s ========================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_NotEq, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -168,7 +168,7 @@
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
- if reply.parent_comment_id == comment.id:
+ if reply.parent_comment_id != comment.id:
replies ={
"comment_id": reply.id,
"commenter": {============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:04.384809', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:04.384809', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:04.384968', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:04.384968', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:39:04.385129', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:39:04.385129', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.728033) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.741344) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.802113) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.804048) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.817675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.384184) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.837122) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.837975) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.839538) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.845014) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.846192) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.847733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.861602) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.880869) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.899899) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.384291) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.920349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.920838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.940845) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.941296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.384333) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.971337) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.971842) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.990848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.991342) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.009685) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.010313) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.384417) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.030728) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.031210) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.031732) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.052066) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.052546) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.053033) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.384457) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.074107) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.074605) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.075207) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.075727) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.080588) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.081071) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.087093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.087573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.088042) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.094039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.094515) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.099310) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.108871) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.114121) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.114551) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.121355) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.121778) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.131711) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.132143) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.141231) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.141686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.384586) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.384809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.384809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.384968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.384968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.384968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.385129) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.385129) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.385129) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.385290) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.385290) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.14s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_Lt, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -67,7 +67,7 @@
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction <reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .................FF............................ [100%]
=================================== FAILURES ===================================
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_post(user.id,post.id,"LIT")
#Assert
reaction_1=Reaction.objects.all()
> assert list(reaction_1)==[]
E assert [<Reaction: R...n object (1)>] == []
E Left contains one more item: <Reaction: Reaction object (1)>
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:229: AssertionError
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_post(user.id,post.id,"WOW")
#Assert
reaction_1=Reaction.objects.all()
> assert reaction_1[0].reaction=="WOW"
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:240:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
return self._result_cache[k]
if isinstance(k, slice):
qs = self._chain()
if k.start is not None:
start = int(k.start)
else:
start = None
if k.stop is not None:
stop = int(k.stop)
else:
stop = None
qs.query.set_limits(start, stop)
return list(qs)[::k.step] if k.step else qs
qs = self._chain()
qs.query.set_limits(k, k + 1)
qs._fetch_all()
> return qs._result_cache[0]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:314: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.005630) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.018751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.080296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.082238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.095747) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.663945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.115397) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.116241) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.117840) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.122498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.123630) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.125172) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.140431) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.159793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.179517) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.664049) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.200959) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.201463) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.664074) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.294122) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.294668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.385086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.385612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.404655) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.405127) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.423766) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.424272) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.664178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.444733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.445355) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.445878) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.465965) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.466456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.466961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.664219) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.487769) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.488264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.488791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.489303) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.494238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.494705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.500852) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.501327) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.501772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.507247) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.507686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.512052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.521957) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.527224) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.527671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.534669) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.535100) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.544985) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.545409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.554609) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.555055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.664342) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.664575) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.664575) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.664747) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.664747) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.664747) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.664910) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.664910) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.664910) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.665077) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.665077) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
================== 2 failed, 45 passed, 67 warnings in 1.15s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_Lt, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -90,7 +90,7 @@
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction <reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................FF..................... [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_comment(user.id,comment.id,"LOVE")
#Assert
reaction_1=Reaction.objects.all()
> assert list(reaction_1)==[]
E assert [<Reaction: R...n object (1)>] == []
E Left contains one more item: <Reaction: Reaction object (1)>
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:303: AssertionError
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_comment(user.id,comment.id,"WOW")
#Assert
reaction_1=Reaction.objects.all()
> assert reaction_1[0].reaction=="WOW"
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:314:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
return self._result_cache[k]
if isinstance(k, slice):
qs = self._chain()
if k.start is not None:
start = int(k.start)
else:
start = None
if k.stop is not None:
stop = int(k.stop)
else:
stop = None
qs.query.set_limits(start, stop)
return list(qs)[::k.step] if k.step else qs
qs = self._chain()
qs.query.set_limits(k, k + 1)
qs._fetch_all()
> return qs._result_cache[0]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:314: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.324816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.338626) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.398473) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.400438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.414353) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.980170) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.433645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.434508) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.436074) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.441712) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.442901) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.444520) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.458519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.477757) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.497266) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.980279) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.518539) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.519068) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.540681) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.541191) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.980322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.572327) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.572816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.592065) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.592588) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.611925) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.612561) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.980409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.633043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.633509) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.634043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.980429) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.726377) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.726912) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.727447) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.809480) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.810055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.810614) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.811125) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.816076) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.816552) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.822866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.823352) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.823847) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.830102) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.830578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.835280) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.844679) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.849339) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.849737) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.856375) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.856806) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.866782) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.867240) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.876519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.876952) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.980582) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.980802) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.980802) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.980961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.980961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.980961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.981119) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.981119) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.981119) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.981277) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.981277) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
================== 2 failed, 45 passed, 67 warnings in 1.16s ===================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/ReplaceComparisonOperator_Eq_Lt, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -115,7 +115,7 @@
if not post_1:
raise InvalidPostException
- if post_1[0].posted_by_id==user_id:
+ if post_1[0].posted_by_id <user_id:
post_1[0].delete()
if not user_1:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.888863) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.903135) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.963813) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.965822) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.980302) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.547402) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.000099) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.000860) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.002336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.006458) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.007485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.009024) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.024531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.043005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.062089) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.547518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.082807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.083302) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.104236) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.104746) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.547564) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.134716) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.135217) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.153802) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.154310) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.172753) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.173380) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.547654) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.194023) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.194517) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.195042) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.215736) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.216255) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.216780) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.547701) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.238332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.238855) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.239385) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.239897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.244928) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.245428) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.251880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.252367) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.252853) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.259108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.259598) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.264493) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.277339) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.283039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.283535) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.290782) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.291274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.300932) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.301413) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.310787) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.311292) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.547837) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.548058) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.548058) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.548221) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.548221) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.548221) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.548383) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.548383) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.548383) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.548540) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.548540) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.02s ========================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_Lt, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -168,7 +168,7 @@
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
- if reply.parent_comment_id == comment.id:
+ if reply.parent_comment_id < comment.id:
replies ={
"comment_id": reply.id,
"commenter": {============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> a=get_post(c)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:486:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:231: in get_post
return get_dict(post)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post = <Post: Post object (1)>
def get_dict(post):
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
> if reply.parent_comment_id < comment.id:
E TypeError: '<' not supported between instances of 'NoneType' and 'int'
fb_post/utils.py:171: TypeError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
> a=get_post(c)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:523:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:231: in get_post
return get_dict(post)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post = <Post: Post object (1)>
def get_dict(post):
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
> if reply.parent_comment_id < comment.id:
E TypeError: '<' not supported between instances of 'NoneType' and 'int'
fb_post/utils.py:171: TypeError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
> a=get_user_posts(d.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:572:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:249: in get_user_posts
res_list.append(get_dict(p))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post = <Post: Post object (1)>
def get_dict(post):
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
> if reply.parent_comment_id < comment.id:
E TypeError: '<' not supported between instances of 'NoneType' and 'int'
fb_post/utils.py:171: TypeError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.135802) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.149519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.209233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.211156) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.224488) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.798696) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.244747) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.245620) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.247288) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.253010) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.254192) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.255786) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.270101) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.289687) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.309073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.798792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.330425) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.330948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.352105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.352600) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.798832) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.382767) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.383259) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.402417) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.402912) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.421623) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.422225) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.798901) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.442949) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.443423) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.443957) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.464558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.465041) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.465547) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.798937) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.486653) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.487139) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.487653) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.488149) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.492753) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.493222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.499267) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.499738) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.500209) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.506289) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.506739) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.511284) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.520867) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.526125) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.526549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.533320) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.533731) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.543415) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.543848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.552857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.553282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.799047) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.799258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.799258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.799404) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.799404) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.799404) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.799549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.799549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.799549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.799685) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.799685) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - Ty...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.15s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_LtE, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -67,7 +67,7 @@
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction <=reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..................F............................ [100%]
=================================== FAILURES ===================================
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_post(user.id,post.id,"WOW")
#Assert
reaction_1=Reaction.objects.all()
> assert reaction_1[0].reaction=="WOW"
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:240:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
return self._result_cache[k]
if isinstance(k, slice):
qs = self._chain()
if k.start is not None:
start = int(k.start)
else:
start = None
if k.stop is not None:
stop = int(k.stop)
else:
stop = None
qs.query.set_limits(start, stop)
return list(qs)[::k.step] if k.step else qs
qs = self._chain()
qs.query.set_limits(k, k + 1)
qs._fetch_all()
> return qs._result_cache[0]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:314: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.031502) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.044683) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.104326) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.106216) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.118956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.681251) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.137645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.138509) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.140138) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.145549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.146723) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.148184) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.161045) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.179467) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.197596) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.681354) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.217583) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.218098) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.237821) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.238364) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.386816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.387363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.406592) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.407083) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.425773) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.426314) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.681477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.447303) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.447958) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.448488) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.469561) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.470113) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.470655) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.681520) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.492365) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.492828) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.493301) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.493772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.498655) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.499103) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.505517) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.506062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.506548) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.513044) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.513563) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.518746) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.529169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.534758) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.535220) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.542576) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.543033) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.553395) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.553836) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.564425) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.564890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.681641) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.681853) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.681853) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.682028) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.682028) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.682028) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.682185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.682185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.682185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.682338) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.682338) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
================== 1 failed, 46 passed, 66 warnings in 1.14s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_LtE, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -90,7 +90,7 @@
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction <=reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................F..................... [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_comment(user.id,comment.id,"WOW")
#Assert
reaction_1=Reaction.objects.all()
> assert reaction_1[0].reaction=="WOW"
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:314:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
return self._result_cache[k]
if isinstance(k, slice):
qs = self._chain()
if k.start is not None:
start = int(k.start)
else:
start = None
if k.stop is not None:
stop = int(k.stop)
else:
stop = None
qs.query.set_limits(start, stop)
return list(qs)[::k.step] if k.step else qs
qs = self._chain()
qs.query.set_limits(k, k + 1)
qs._fetch_all()
> return qs._result_cache[0]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:314: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.990026) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.003509) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.061846) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.063703) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.077004) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.637614) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.095806) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.096611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.098145) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.102524) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.103606) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.105137) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.119581) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.137466) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.155652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.637703) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.175830) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.176326) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.197167) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.197667) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.637737) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.227577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.228081) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.246951) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.247448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.266096) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.266727) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.637803) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.287269) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.287744) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.288249) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.308292) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.308783) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.309293) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.448939) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.449460) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.449982) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.450461) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.455199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.455656) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.461717) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.462211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.462686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.468808) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.469276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.474044) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.483790) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.488896) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.489317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.495901) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.496296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.505590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.506015) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.514897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.515314) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.637980) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.638181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.638181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.638317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.638317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.638317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.638449) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.638449) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.638449) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.638582) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.638582) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
================== 1 failed, 46 passed, 66 warnings in 1.13s ===================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/ReplaceComparisonOperator_Eq_LtE, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -115,7 +115,7 @@
if not post_1:
raise InvalidPostException
- if post_1[0].posted_by_id==user_id:
+ if post_1[0].posted_by_id <=user_id:
post_1[0].delete()
if not user_1:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.371950) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.385546) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.442855) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.444795) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.459023) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.019678) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.479100) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.479970) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.481569) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.487358) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.488503) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.490092) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.504357) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.523381) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.542450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.019776) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.562743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.563206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.583438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.583940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.019823) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.614068) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.614586) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.633027) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.633521) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.652382) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.653030) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.019911) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.673086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.673561) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.674105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.693940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.694422) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.694935) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.019956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.715438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.715909) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.716408) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.716897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.721500) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.721965) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.727852) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.728307) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.728758) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.734816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.735263) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.740006) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.751516) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.756613) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.757068) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.763963) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.764443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.774110) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.774566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.783288) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.783772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.020070) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.020278) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.020278) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.020438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.020438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.020438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.020597) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.020597) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.020597) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.020764) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.020764) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.01s ========================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_LtE, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -168,7 +168,7 @@
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
- if reply.parent_comment_id == comment.id:
+ if reply.parent_comment_id <= comment.id:
replies ={
"comment_id": reply.id,
"commenter": {============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> a=get_post(c)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:486:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:231: in get_post
return get_dict(post)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post = <Post: Post object (1)>
def get_dict(post):
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
> if reply.parent_comment_id <= comment.id:
E TypeError: '<=' not supported between instances of 'NoneType' and 'int'
fb_post/utils.py:171: TypeError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
> a=get_post(c)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:523:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:231: in get_post
return get_dict(post)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post = <Post: Post object (1)>
def get_dict(post):
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
> if reply.parent_comment_id <= comment.id:
E TypeError: '<=' not supported between instances of 'NoneType' and 'int'
fb_post/utils.py:171: TypeError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
> a=get_user_posts(d.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:572:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:249: in get_user_posts
res_list.append(get_dict(p))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post = <Post: Post object (1)>
def get_dict(post):
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
> if reply.parent_comment_id <= comment.id:
E TypeError: '<=' not supported between instances of 'NoneType' and 'int'
fb_post/utils.py:171: TypeError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.893246) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.907362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.968164) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.970237) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.984908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.540006) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.005349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.006276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.007974) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.013822) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.014998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.016566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.031880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.051623) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.071066) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.540122) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.092105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.092602) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.113117) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.113600) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.540168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.143443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.143939) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.163023) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.163535) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.182310) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.182922) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.540251) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.203636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.204127) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.204631) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.225296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.225799) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.226336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.540297) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.245362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.245814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.246329) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.246807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.251610) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.252117) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.258461) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.258913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.259359) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.265233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.265674) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.270196) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.279608) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.284678) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.285104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.291717) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.292108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.301621) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.302056) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.310926) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.311341) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.540427) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.540652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.540652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.540821) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.540821) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.540821) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.540988) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.540988) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.540988) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.541154) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.541154) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - Ty...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.16s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_Gt, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -67,7 +67,7 @@
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction >reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .................F............................. [100%]
=================================== FAILURES ===================================
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_post(user.id,post.id,"LIT")
#Assert
reaction_1=Reaction.objects.all()
> assert list(reaction_1)==[]
E assert [<Reaction: R...n object (1)>] == []
E Left contains one more item: <Reaction: Reaction object (1)>
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:229: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.350911) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.364719) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.423918) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.425928) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.439497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.007148) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.459107) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.459929) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.461496) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.466105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.467225) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.468806) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.483570) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.501662) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.520191) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.007264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.540741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.541218) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.007286) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.632059) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.632598) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.007308) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.662978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.663444) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.681800) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.682306) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.700468) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.701072) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.007395) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.721345) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.721811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.722329) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.742550) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.743034) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.743557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.007435) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.764454) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.764923) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.765416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.765898) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.770531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.770986) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.776958) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.777441) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.777943) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.784504) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.784965) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.789698) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.799492) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.804530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.804949) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.811599) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.812010) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.821681) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.822133) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.831105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.831525) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.007559) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.007792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.007792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.007961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.007961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.007961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.008123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.008123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.008123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.008285) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.008285) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
================== 1 failed, 46 passed, 68 warnings in 1.07s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_Gt, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -90,7 +90,7 @@
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction >reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................F...................... [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_comment(user.id,comment.id,"LOVE")
#Assert
reaction_1=Reaction.objects.all()
> assert list(reaction_1)==[]
E assert [<Reaction: R...n object (1)>] == []
E Left contains one more item: <Reaction: Reaction object (1)>
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:303: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.925569) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.938927) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.997639) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.999554) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.013427) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.580142) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.032690) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.033516) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.035130) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.039487) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.040571) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.042069) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.056537) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.075230) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.093949) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.580252) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.114159) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.114629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.135308) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.135804) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.580292) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.166265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.166764) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.185783) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.186304) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.204887) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.205500) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.580380) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.225815) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.226309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.226813) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.580400) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.316677) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.317205) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.317736) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.580419) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.338713) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.339214) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.339737) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.340231) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.345538) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.346026) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.352146) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.352595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.353051) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.359042) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.359504) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.364450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.374443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.379619) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.380035) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.386553) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.386965) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.396176) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.396616) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.405338) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.405772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.580546) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.580776) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.580776) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.580945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.580945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.580945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.581111) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.581111) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.581111) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.581283) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.581283) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
================== 1 failed, 46 passed, 68 warnings in 1.08s ===================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/ReplaceComparisonOperator_Eq_Gt, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -115,7 +115,7 @@
if not post_1:
raise InvalidPostException
- if post_1[0].posted_by_id==user_id:
+ if post_1[0].posted_by_id >user_id:
post_1[0].delete()
if not user_1:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.442052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.456304) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.515057) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.517075) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.531582) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.088744) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.551724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.552590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.554264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.559921) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.561094) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.562741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.577396) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.596907) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.616402) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.088857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.637629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.638173) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.659644) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.660175) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.088901) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.691004) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.691535) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.711237) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.711782) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.731026) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.731672) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.088989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.752541) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.753001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.753499) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.773820) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.774336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.774869) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.089035) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.795568) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.796022) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.796519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.797027) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.801611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.802104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.808310) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.808808) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.809296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.815610) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.816095) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.821007) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.830900) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.838442) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.838919) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.846038) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.846528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.856905) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.857394) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.866897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.867382) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.089159) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.089394) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.089394) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.089558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.089558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.089558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.089720) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.089720) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.089720) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.089879) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.089879) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.03s ========================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_Gt, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -168,7 +168,7 @@
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
- if reply.parent_comment_id == comment.id:
+ if reply.parent_comment_id > comment.id:
replies ={
"comment_id": reply.id,
"commenter": {============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> a=get_post(c)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:486:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:231: in get_post
return get_dict(post)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post = <Post: Post object (1)>
def get_dict(post):
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
> if reply.parent_comment_id > comment.id:
E TypeError: '>' not supported between instances of 'NoneType' and 'int'
fb_post/utils.py:171: TypeError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
> a=get_post(c)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:523:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:231: in get_post
return get_dict(post)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post = <Post: Post object (1)>
def get_dict(post):
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
> if reply.parent_comment_id > comment.id:
E TypeError: '>' not supported between instances of 'NoneType' and 'int'
fb_post/utils.py:171: TypeError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
> a=get_user_posts(d.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:572:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:249: in get_user_posts
res_list.append(get_dict(p))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post = <Post: Post object (1)>
def get_dict(post):
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
> if reply.parent_comment_id > comment.id:
E TypeError: '>' not supported between instances of 'NoneType' and 'int'
fb_post/utils.py:171: TypeError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.985195) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.993848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.029518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.030813) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.039393) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.657761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.051322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.051877) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.052899) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.055707) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.056457) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.057486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.066770) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.078188) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.089780) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.657869) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.102593) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.102914) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.115666) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.115991) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.657929) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.134472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.134796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.146192) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.146505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.157668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.158097) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.658015) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.170434) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.170747) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.171088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.183150) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.183466) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.183826) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.658059) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.196254) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.196567) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.196901) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.197228) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.200151) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.200462) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.204319) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.204640) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.204956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.208808) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.209126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.212109) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.218317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.221602) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.221891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.226284) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.226562) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.232756) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.233039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.238812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.239107) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.658192) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.658416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.658416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.658575) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.658575) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.658575) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.658731) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.658731) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.658731) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.658884) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.658884) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - Ty...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 0.82s ===================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/ReplaceComparisonOperator_Eq_GtE, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -67,7 +67,7 @@
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction >=reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.026533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.039852) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.098772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.100723) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.114631) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.677507) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.134599) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.135441) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.137062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.141652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.142791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.144360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.159215) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.178173) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.197465) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.677623) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.217719) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.218214) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.238053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.238521) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.677668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.267891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.268382) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.286888) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.287349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.305920) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.306556) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.677754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.327502) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.327987) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.328501) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.349074) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.349570) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.350116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.677800) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.371034) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.371516) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.372028) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.372521) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.377079) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.377530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.383372) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.383829) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.384276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.390300) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.390768) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.395420) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.404718) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.409762) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.410210) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.417019) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.417441) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.426924) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.427324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.436237) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.436669) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.677950) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.678181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.678181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.678346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.678346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.678346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.678515) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.678515) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.678515) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.678679) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.678679) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.00s ========================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/ReplaceComparisonOperator_Eq_GtE, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -90,7 +90,7 @@
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction >=reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.420298) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.434245) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.494015) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.495959) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.510235) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.069361) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.530346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.531178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.532724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.537206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.538339) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.539892) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.554975) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.573729) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.593006) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.069478) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.614157) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.614638) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.635493) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.635968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.069529) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.666493) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.666983) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.685996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.686491) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.705388) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.706041) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.069612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.726178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.726623) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.727098) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.745811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.746350) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.746890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.069664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.767882) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.768366) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.768876) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.769372) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.774199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.774674) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.780802) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.781278) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.781749) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.787833) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.788302) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.793089) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.802867) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.808157) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.808583) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.815522) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.815948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.825882) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.826308) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.835401) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.835828) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.069793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.070058) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.070058) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.070233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.070233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.070233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.070404) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.070404) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.070404) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.070571) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.070571) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.01s ========================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/ReplaceComparisonOperator_Eq_GtE, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -115,7 +115,7 @@
if not post_1:
raise InvalidPostException
- if post_1[0].posted_by_id==user_id:
+ if post_1[0].posted_by_id >=user_id:
post_1[0].delete()
if not user_1:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.947968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.962188) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.022677) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.024595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.038656) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.597807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.058265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.059109) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.060728) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.066358) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.067496) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.069037) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.083073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.101549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.120178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.597942) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.140510) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.140988) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.161152) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.161656) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.597989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.191228) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.191712) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.209960) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.210439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.229135) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.229761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.598076) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.250596) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.251079) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.251596) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.272321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.272831) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.273361) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.598122) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.294575) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.295081) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.295601) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.296100) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.301056) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.301530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.307708) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.308184) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.308652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.314861) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.315336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.320173) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.330062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.337491) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.337979) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.344841) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.345318) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.355503) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.356007) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.365516) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.366028) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.598252) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.598477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.598477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.598645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.598645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.598645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.598814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.598814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.598814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.598984) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.598984) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.03s ========================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_GtE, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -168,7 +168,7 @@
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
- if reply.parent_comment_id == comment.id:
+ if reply.parent_comment_id >= comment.id:
replies ={
"comment_id": reply.id,
"commenter": {============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> a=get_post(c)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:486:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:231: in get_post
return get_dict(post)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post = <Post: Post object (1)>
def get_dict(post):
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
> if reply.parent_comment_id >= comment.id:
E TypeError: '>=' not supported between instances of 'NoneType' and 'int'
fb_post/utils.py:171: TypeError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
> a=get_post(c)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:523:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:231: in get_post
return get_dict(post)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post = <Post: Post object (1)>
def get_dict(post):
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
> if reply.parent_comment_id >= comment.id:
E TypeError: '>=' not supported between instances of 'NoneType' and 'int'
fb_post/utils.py:171: TypeError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
> a=get_user_posts(d.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:572:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:249: in get_user_posts
res_list.append(get_dict(p))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post = <Post: Post object (1)>
def get_dict(post):
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
> if reply.parent_comment_id >= comment.id:
E TypeError: '>=' not supported between instances of 'NoneType' and 'int'
fb_post/utils.py:171: TypeError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.190243) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.204611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.266301) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.268260) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.282480) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.833285) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.302058) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.302887) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.304498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.310116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.311179) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.312648) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.326240) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.345515) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.364922) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.833405) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.385607) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.386106) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.406935) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.407440) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.833447) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.437654) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.438184) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.457072) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.457581) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.476285) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.476926) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.833530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.497411) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.497880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.498412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.518651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.519155) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.519684) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.833577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.540671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.541164) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.541696) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.542224) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.547023) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.547486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.553582) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.554087) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.554562) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.560635) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.561105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.565839) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.575503) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.580739) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.581178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.587944) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.588340) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.598311) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.598747) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.608025) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.608473) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.833710) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.833971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.833971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.834150) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.834150) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.834150) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.834324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.834324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.834324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.834500) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.834500) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - Ty...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.18s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_Is, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -67,7 +67,7 @@
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction isreaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp1a9f8hkf/repo/fb_post/utils.py", line 70
E if reaction_2[0].reaction isreaction_type:
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_Is, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -90,7 +90,7 @@
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction isreaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmp1a9f8hkf/repo/fb_post/utils.py", line 93
E if reaction_2[0].reaction isreaction_type:
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_Is, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -115,7 +115,7 @@
if not post_1:
raise InvalidPostException
- if post_1[0].posted_by_id==user_id:
+ if post_1[0].posted_by_id isuser_id:
post_1[0].delete()
if not user_1:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpx1jaj20f/repo/fb_post/utils.py", line 118
E if post_1[0].posted_by_id isuser_id:
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.30s ===============================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/ReplaceComparisonOperator_Eq_Is, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -168,7 +168,7 @@
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
- if reply.parent_comment_id == comment.id:
+ if reply.parent_comment_id is comment.id:
replies ={
"comment_id": reply.id,
"commenter": {============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.453801) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.467721) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.528246) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.530202) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.543651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.103394) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.562940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.563793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.565379) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.570891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.572020) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.573564) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.587758) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.606818) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.625839) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.103485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.646294) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.646789) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.666915) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.667383) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.103519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.696838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.697350) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.716557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.717084) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.736464) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.737113) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.103591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.757811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.758322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.758849) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.779227) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.779736) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.780261) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.103622) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.801630) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.802144) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.802655) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.803160) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.808029) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.808500) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.814680) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.815161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.815637) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.821705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.822206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.826996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.836940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.842253) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.842689) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.849556) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.850026) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.859934) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.860378) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.869501) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.869945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.103734) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.103949) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.103949) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.104088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.104088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.104088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.104222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.104222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.104222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.104352) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.104352) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.02s ========================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_IsNot, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -67,7 +67,7 @@
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction is notreaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .................FF............................ [100%]
=================================== FAILURES ===================================
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"LIT")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LIT'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not post_1:
raise InvalidPostException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
> if reaction_2[0].reaction is notreaction_type:
E NameError: name 'notreaction_type' is not defined
fb_post/utils.py:70: NameError
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:237:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'WOW'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not post_1:
raise InvalidPostException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
> if reaction_2[0].reaction is notreaction_type:
E NameError: name 'notreaction_type' is not defined
fb_post/utils.py:70: NameError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.981688) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.995188) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.054490) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.056365) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.069069) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.634298) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.087488) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.088286) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.089775) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.093978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.095023) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.096451) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.111091) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.128787) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.146784) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.634396) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.166063) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.166539) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.270177) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.270750) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.320603) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.321104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.340743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.341237) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.360455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.360990) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.634533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.382135) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.382770) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.383297) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.404042) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.404538) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.405057) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.634581) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.425099) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.425575) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.426098) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.426601) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.431559) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.432028) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.438084) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.438549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.439006) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.444691) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.445194) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.450054) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.459986) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.465155) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.465578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.472566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.472978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.482676) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.483108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.492158) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.492572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.634709) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.634924) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.634924) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.635088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.635088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.635088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.635267) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.635267) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.635267) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.635434) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.635434) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
================== 2 failed, 45 passed, 66 warnings in 1.12s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_IsNot, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -90,7 +90,7 @@
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[0].reaction is notreaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................FF..................... [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:300:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'LOVE'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not comment_1:
raise InvalidCommentException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
> if reaction_2[0].reaction is notreaction_type:
E NameError: name 'notreaction_type' is not defined
fb_post/utils.py:93: NameError
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:311:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not comment_1:
raise InvalidCommentException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
> if reaction_2[0].reaction is notreaction_type:
E NameError: name 'notreaction_type' is not defined
fb_post/utils.py:93: NameError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.875557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.889083) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.949263) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.951199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.964529) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.529691) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.983768) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.984535) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.986077) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.990408) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.991483) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.992966) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.007410) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.025948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.044310) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.529783) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.064482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.064982) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.085680) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.086192) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.529823) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.116648) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.117188) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.136274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.136784) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.156129) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.156793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.529891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.176860) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.177368) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.177885) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.283112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.283677) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.284246) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.324450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.325019) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.325579) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.326123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.331187) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.331671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.338297) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.338796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.339279) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.345566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.346108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.350992) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.360894) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.366318) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.366753) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.373665) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.374137) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.384214) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.384647) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.393914) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.394348) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.530064) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.530275) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.530275) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.530416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.530416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.530416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.530550) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.530550) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.530550) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.530680) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.530680) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
================== 2 failed, 45 passed, 66 warnings in 1.12s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_IsNot, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -115,7 +115,7 @@
if not post_1:
raise InvalidPostException
- if post_1[0].posted_by_id==user_id:
+ if post_1[0].posted_by_id is notuser_id:
post_1[0].delete()
if not user_1:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................F.F.............. [100%]
=================================== FAILURES ===================================
__________ test_delete_post_for_user_id_raises_invalid_user_exception __________
post = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_user_id_raises_invalid_user_exception(post):
#Arrange
#Act
with pytest.raises(InvalidUserException):
> delete_post(7,post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:356:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 7, post_id = 1
def delete_post(user_id, post_id):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
if not post_1:
raise InvalidPostException
> if post_1[0].posted_by_id is notuser_id:
E NameError: name 'notuser_id' is not defined
fb_post/utils.py:118: NameError
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1
def delete_post(user_id, post_id):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
if not post_1:
raise InvalidPostException
> if post_1[0].posted_by_id is notuser_id:
E NameError: name 'notuser_id' is not defined
fb_post/utils.py:118: NameError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.858354) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.871597) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.930854) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.932709) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.946444) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.511543) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.966104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.966936) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.968479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.972861) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.973960) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.975455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.990342) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.009784) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.029550) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.511648) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.050114) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.050591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.069718) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.070253) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.511693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.099340) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.099878) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.118491) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.119020) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.136924) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.137596) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.511769) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.157483) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.157978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.158497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.178038) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.178566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.179092) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.511812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.200769) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.201279) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.201806) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.202336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.207222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.207671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.213456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.213922) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.214361) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.220123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.220578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.225071) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.318977) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.343882) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.344351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.351664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.352105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.362546) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.363025) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.372663) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.373137) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.511934) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.512148) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.512148) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.512303) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.512303) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.512303) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.512460) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.512460) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.512460) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.512614) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.512614) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 2 failed, 45 passed, 67 warnings in 1.12s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_Eq_IsNot, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -168,7 +168,7 @@
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
- if reply.parent_comment_id == comment.id:
+ if reply.parent_comment_id is not comment.id:
replies ={
"comment_id": reply.id,
"commenter": {============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:37.437014', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:37.437014', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:37.437174', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:37.437174', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:37.437332', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:37.437332', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.784375) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.798132) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.858146) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.860082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.873829) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.436390) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.892836) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.893659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.895264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.899697) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.900843) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.902427) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.917270) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.935617) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.953918) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.436498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.973783) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.974286) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.994554) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.995059) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.436542) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.024490) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.024962) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.043342) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.043829) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.062078) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.062678) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.436630) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.082596) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.083059) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.083562) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.103199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.103665) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.104179) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.436675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.124253) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.124716) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.125217) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.125705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.130363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.130828) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.136733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.137197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.137666) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.143623) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.144103) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.148772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.158408) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.163463) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.163898) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.170602) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.171017) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.180606) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.181025) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.189950) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.190373) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.436809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.437014) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.437014) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.437174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.437174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.437174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.437332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.437332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.437332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.437490) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.437490) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_NotEq_Eq, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -120,7 +120,7 @@
if not user_1:
raise InvalidUserException
- if post_1[0].posted_by_id!=user_id:
+ if post_1[0].posted_by_id ==user_id:
raise UserCannotDeletePostException
#task 10============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ................................F.............. [100%]
=================================== FAILURES ===================================
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.UserCannotDeletePostException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374: Failed
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.016213) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.029226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.085401) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.087201) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.100121) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.674470) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.119043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.119831) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.121346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.126637) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.127741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.129254) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.142483) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.161265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.180913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.674575) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.202353) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.202878) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.224334) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.224847) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.674615) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.255753) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.256260) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.275207) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.275690) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.294354) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.294978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.674693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.315657) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.316139) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.316659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.337564) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.338087) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.338611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.674733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.359751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.360233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.360745) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.361248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.366117) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.366587) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.372634) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.373096) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.373563) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.379613) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.380084) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.384888) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.394686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.478054) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.478532) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.485523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.485971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.496113) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.496532) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.505613) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.506071) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.674860) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.675082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.675082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.675247) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.675247) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.675247) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.675414) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.675414) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.675414) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.675570) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.675570) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 1 failed, 46 passed, 67 warnings in 1.09s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_NotEq_Lt, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -120,7 +120,7 @@
if not user_1:
raise InvalidUserException
- if post_1[0].posted_by_id!=user_id:
+ if post_1[0].posted_by_id <user_id:
raise UserCannotDeletePostException
#task 10============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ................................F.............. [100%]
=================================== FAILURES ===================================
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.UserCannotDeletePostException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374: Failed
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.841330) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.855854) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.915410) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.917168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.929628) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.492430) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.948423) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.949229) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.950744) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.955108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.956196) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.957704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.972712) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.990536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.008581) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.492545) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.028444) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.028925) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.049431) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.049926) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.492591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.079452) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.079956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.099162) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.099646) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.118578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.119214) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.492673) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.139632) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.140087) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.140565) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.160675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.161171) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.161700) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.492720) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.182238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.182714) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.183239) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.183745) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.188523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.188993) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.195089) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.195560) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.196017) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.202142) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.202615) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.207475) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.217424) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.299824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.300313) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.307580) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.308010) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.318176) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.318612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.327794) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.328213) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.492851) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.493073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.493073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.493248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.493248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.493248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.493421) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.493421) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.493421) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.493593) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.493593) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 1 failed, 46 passed, 67 warnings in 1.09s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_NotEq_LtE, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -120,7 +120,7 @@
if not user_1:
raise InvalidUserException
- if post_1[0].posted_by_id!=user_id:
+ if post_1[0].posted_by_id <=user_id:
raise UserCannotDeletePostException
#task 10============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ................................F.............. [100%]
=================================== FAILURES ===================================
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.UserCannotDeletePostException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374: Failed
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.671920) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.685319) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.744667) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.746551) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.760129) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.319619) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.777679) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.778476) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.779955) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.784435) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.785567) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.787248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.801857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.820446) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.838719) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.319732) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.859198) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.859685) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.879926) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.880438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.319786) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.909666) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.910146) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.927851) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.928371) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.945854) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.946523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.319869) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.966701) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.967195) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.967704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.987605) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.988130) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.988641) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.319911) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.008657) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.009170) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.009698) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.010224) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.015181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.015657) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.024284) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.024775) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.025251) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.031646) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.032124) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.037067) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.047256) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.129917) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.130448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.137857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.138343) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.148831) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.149294) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.161777) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.162247) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.320036) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.320269) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.320269) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.320438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.320438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.320438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.320612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.320612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.320612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.320783) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.320783) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 1 failed, 46 passed, 67 warnings in 1.09s ===================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/ReplaceComparisonOperator_NotEq_Gt, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -120,7 +120,7 @@
if not user_1:
raise InvalidUserException
- if post_1[0].posted_by_id!=user_id:
+ if post_1[0].posted_by_id >user_id:
raise UserCannotDeletePostException
#task 10============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.027155) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.040529) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.100746) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.102648) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.116258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.677434) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.135524) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.136319) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.137846) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.143373) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.144529) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.146087) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.159518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.177924) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.196771) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.677532) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.217527) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.218031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.239059) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.239557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.677571) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.270495) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.271025) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.289298) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.289820) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.309398) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.310085) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.677639) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.330845) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.331309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.331820) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.351968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.352461) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.352966) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.677676) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.373629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.374156) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.374681) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.375175) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.379934) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.380407) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.386580) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.387051) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.387533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.393608) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.394101) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.398801) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.408485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.413611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.414063) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.420971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.421406) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.431233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.431672) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.440901) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.441349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.677792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.678039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.678039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.678207) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.678207) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.678207) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.678360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.678360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.678360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.678505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.678505) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.01s ========================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/ReplaceComparisonOperator_NotEq_GtE, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -120,7 +120,7 @@
if not user_1:
raise InvalidUserException
- if post_1[0].posted_by_id!=user_id:
+ if post_1[0].posted_by_id >=user_id:
raise UserCannotDeletePostException
#task 10============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.211089) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.224079) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.282265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.284162) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.297519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.861389) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.316733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.317560) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.319152) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.324405) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.325483) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.326970) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.340425) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.359091) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.377577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.861501) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.397698) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.398185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.418382) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.418872) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.861545) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.449470) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.450012) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.469165) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.469653) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.488593) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.489221) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.861633) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.509282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.509740) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.510256) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.530458) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.530938) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.531443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.861676) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.552224) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.552693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.553198) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.553688) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.558422) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.558881) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.564903) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.565366) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.565825) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.571802) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.572258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.576862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.586208) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.591326) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.591734) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.598297) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.598690) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.607937) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.608337) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.617367) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.617798) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.861805) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.862043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.862043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.862215) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.862215) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.862215) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.862386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.862386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.862386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.862554) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.862554) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.01s ========================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_NotEq_Is, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -120,7 +120,7 @@
if not user_1:
raise InvalidUserException
- if post_1[0].posted_by_id!=user_id:
+ if post_1[0].posted_by_id isuser_id:
raise UserCannotDeletePostException
#task 10============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 0 items / 1 error
==================================== ERRORS ====================================
______________________ ERROR collecting fb_post/tests.py _______________________
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/python.py:513: in _importtestmodule
mod = self.fspath.pyimport(ensuresyspath=importmode)
/home/ubuntu/.venv/lib/python3.6/site-packages/py/_path/local.py:701: in pyimport
__import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:665: in _load_unlocked
???
/home/ubuntu/.venv/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:152: in exec_module
exec(co, module.__dict__)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:2: in <module>
from .utils import *
E File "/tmp/tmpdyrkz0jr/repo/fb_post/utils.py", line 123
E if post_1[0].posted_by_id isuser_id:
E ^
E SyntaxError: invalid syntax
=========================== short test summary info ============================
ERROR fb_post/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.29s ===============================
worker outcome: normal
test outcome: killed
operator: core/ReplaceComparisonOperator_NotEq_IsNot, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -120,7 +120,7 @@
if not user_1:
raise InvalidUserException
- if post_1[0].posted_by_id!=user_id:
+ if post_1[0].posted_by_id is notuser_id:
raise UserCannotDeletePostException
#task 10============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ................................F.............. [100%]
=================================== FAILURES ===================================
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1
def delete_post(user_id, post_id):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
if not post_1:
raise InvalidPostException
if post_1[0].posted_by_id==user_id:
post_1[0].delete()
if not user_1:
raise InvalidUserException
> if post_1[0].posted_by_id is notuser_id:
E NameError: name 'notuser_id' is not defined
fb_post/utils.py:123: NameError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.989005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.002584) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.061637) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.063561) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.076927) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.636531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.095805) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.096611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.098145) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.103562) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.104714) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.106235) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.119581) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.137466) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.155651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.636633) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.175830) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.176326) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.197167) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.197667) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.636675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.227577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.228081) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.246951) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.247449) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.266096) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.266727) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.636754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.287269) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.287744) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.288249) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.308292) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.308783) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.309293) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.636794) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.329991) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.330479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.330990) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.331480) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.336251) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.336709) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.342765) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.343231) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.343694) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.349722) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.350206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.354971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.364777) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.453697) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.454210) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.461326) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.461746) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.471907) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.472346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.481498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.481950) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.636919) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.637148) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.637148) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.637307) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.637307) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.637307) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.637465) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.637465) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.637465) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.637620) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.637620) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 1 failed, 46 passed, 67 warnings in 1.10s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_USub_UAdd, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -176,7 +176,7 @@
"name": reply.commented_by.name,
"profile_pic": reply.commented_by.profile_pic
},
- "commented_at": str(reply.commented_at)[:-6],
+ "commented_at": str(reply.commented_at)[:+6],
"comment_content": reply.content,
"reactions": {
"count": reply.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..........................................F.F.. [100%]
=================================== FAILURES ===================================
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:57.468001', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:57.468001', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:57.468168', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:57.468168', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.824172) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.838506) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.900574) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.902637) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.916748) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.467194) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.935248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.936157) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.937798) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.943920) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.945153) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.946808) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.961563) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.981103) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.000819) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.467299) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.021457) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.021961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.042525) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.043026) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.467340) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.073569) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.074127) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.092810) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.093281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.111601) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.112205) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.467424) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.132683) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.133174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.133704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.153844) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.154362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.154878) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.467468) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.175867) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.176355) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.176877) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.177372) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.182178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.182658) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.188550) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.189006) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.189464) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.195325) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.195770) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.200440) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.210004) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.214998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.215412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.222286) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.222712) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.232326) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.232736) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.241761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.242212) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.467594) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.467824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.467824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.468001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.468001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.468001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.468168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.468168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.468168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.468336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.468336) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 2 failed, 45 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_USub_UAdd, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -192,7 +192,7 @@
"name": comment.commented_by.name,
"profile_pic": comment.commented_by.profile_pic
},
- "commented_at": str(comment.commented_at)[:-6],
+ "commented_at": str(comment.commented_at)[:+6],
"comment_content": comment.content,
"reactions": {
"count": comment.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-0', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:54.512936', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-0', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:54.513088', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:54.513244', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-0', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.855338) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.869386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.928458) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.930408) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.944088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.512335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.964084) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.964984) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.966687) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.971501) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.972669) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.974355) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.990024) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.009562) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.028869) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.512438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.049733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.050243) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.071455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.071956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.512479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.102964) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.103487) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.123276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.123822) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.143515) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.144179) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.512559) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.165018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.165509) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.166056) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.186654) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.187153) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.187675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.512603) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.208480) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.208954) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.209462) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.209984) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.214767) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.215235) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.221156) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.221646) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.222144) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.228250) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.228724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.233395) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.243022) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.248178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.248612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.255488) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.255913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.265670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.266118) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.275225) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.275670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.512722) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.512936) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.512936) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.513088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.513088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.513088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.513244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.513244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.513244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.513403) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.513403) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.14s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_USub_UAdd, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -210,7 +210,7 @@
"user_id": post.posted_by_id,
"profile_pic": post.posted_by.profile_pic
},
- "posted_at": str(post.posted_at)[:-6],
+ "posted_at": str(post.posted_at)[:+6],
"post_content": post.content,
"reactions": {
"count": post.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................................FFF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_comments_return_empty_list _______________
user = <User: User object (1)>
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_comments_return_empty_list(user):
#Arrange
create_post(1,"happy birthday")
#Act
a=get_post(1)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'sharmila',
'user_id': 1,
'profile_pic': 'www.google.com'
},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []
},
'comments': [],
'comments_count': 0
}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-0'} != {'posted_at': '2020-04-20 10:39:16.186016'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:460: AssertionError
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-0'} != {'posted_at': '2020-04-20 10:39:16.186241'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-0'} != {'posted_at': '2020-04-20 10:39:16.186411'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-0', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:39:16.186576', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.529986) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.543141) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.602055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.604010) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.617659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.185568) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.636665) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.637451) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.639005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.644264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.645321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.646811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.660078) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.678301) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.696761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.185685) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.716783) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.717270) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.738282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.738788) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.185733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.769134) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.769638) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.788530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.789021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.807214) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.807815) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.185818) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.827562) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.828032) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.828542) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.848306) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.848764) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.849250) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.185861) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.869668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.870173) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.870674) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.871163) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.875675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.876128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.881763) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.882226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.882671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.888393) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.888848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.893555) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.903277) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.908322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.908742) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.915246) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.915636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.924900) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.925335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.934165) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.934576) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.186016) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.186241) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.186241) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.186411) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.186411) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.186411) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.186576) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.186576) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.186576) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.186741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.186741) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_comments_return_empty_list - A...
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 4 failed, 43 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_USub_UAdd, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -264,7 +264,7 @@
user_dict["name"]=i.commented_by.name
user_dict["profile_pic"]=i.commented_by.profile_pic
comment_dict["commenter"]=user_dict
- comment_dict["commented_at"]=str(i.commented_at)[:-6]
+ comment_dict["commented_at"]=str(i.commented_at)[:+6]
comment_dict["comment_content"]=i.content
comment_list.append(comment_dict)
comment_dict={}============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................................F [100%]
=================================== FAILURES ===================================
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
e=reply_to_comment(d.id,b, "Thanks for ur wishes")
#Assert
> assert get_replies_for_comment(b)== [{
"comment_id": 2,
"commenter": {
"user_id": 1,
"name": "srinu",
"profile_pic": "www.facebook.com"
},
"commented_at": str(datetime.now()),
"comment_content": "Thanks for ur wishes",
}]
E AssertionError: assert [{'comment_co...user_id': 1}}] == [{'comment_co...user_id': 1}}]
E At index 0 diff: {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-0', 'comment_content': 'Thanks for ur wishes'} != {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:39:10.188656', 'comment_content': 'Thanks for ur wishes'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:621: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.532974) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.546650) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.606281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.608247) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.622051) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.187519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.641173) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.642004) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.643582) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.648744) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.649817) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.651297) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.664471) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.682605) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.701278) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.187630) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.721287) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.721765) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.741252) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.741712) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.187678) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.769883) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.770422) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.787904) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.788421) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.807372) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.808042) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.187763) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.828052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.828558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.829072) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.849196) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.849718) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.850265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.187809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.870431) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.870917) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.871458) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.871959) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.876713) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.877185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.883341) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.883836) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.884314) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.890577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.891073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.895899) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.905683) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.910879) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.911317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.918159) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.918583) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.928003) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.928455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.937867) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.938379) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.187931) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.188152) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.188152) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.188315) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.188315) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.188315) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.188485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.188485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.188485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.188656) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.188656) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 1 failed, 46 passed, 67 warnings in 1.09s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_USub_Invert, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -176,7 +176,7 @@
"name": reply.commented_by.name,
"profile_pic": reply.commented_by.profile_pic
},
- "commented_at": str(reply.commented_at)[:-6],
+ "commented_at": str(reply.commented_at)[:~6],
"comment_content": reply.content,
"reactions": {
"count": reply.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..........................................F.F.. [100%]
=================================== FAILURES ===================================
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:44.125862', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:44.125862', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:44.126038', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:44.126038', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.471749) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.484958) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.543163) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.544982) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.558080) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.125052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.577080) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.577866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.579377) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.584547) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.585623) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.587094) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.600197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.618543) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.637055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.125165) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.657631) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.658133) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.678713) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.679197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.125211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.709111) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.709629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.727704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.728170) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.746215) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.746806) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.125294) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.766952) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.767417) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.767915) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.788099) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.788591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.789094) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.125340) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.810212) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.810709) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.811225) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.811726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.816704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.817163) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.823605) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.824109) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.824590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.831085) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.831579) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.836624) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.847029) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.852421) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.852862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.859887) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.860309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.870327) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.870760) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.880834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.881281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.125467) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.125691) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.125691) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.125862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.125862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.125862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.126038) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.126038) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.126038) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.126179) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.126179) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 2 failed, 45 passed, 67 warnings in 1.11s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_USub_Invert, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -192,7 +192,7 @@
"name": comment.commented_by.name,
"profile_pic": comment.commented_by.profile_pic
},
- "commented_at": str(comment.commented_at)[:-6],
+ "commented_at": str(comment.commented_at)[:~6],
"comment_content": comment.content,
"reactions": {
"count": comment.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:51.31849', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:51.318495', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:51.31866', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:51.318664', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:51.318831', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:51.31883', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic'...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.661871) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.676267) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.732633) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.734630) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.747497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.317832) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.766047) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.766963) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.768701) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.773364) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.774476) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.775980) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.790743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.808573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.826181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.317967) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.846371) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.846851) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.868202) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.868733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.318012) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.899927) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.900474) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.919997) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.920515) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.940065) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.940740) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.318100) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.962013) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.962518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.963055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.983983) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.984482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.984999) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.318149) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.005656) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.006150) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.006653) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.007145) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.011869) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.012331) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.018405) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.018873) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.019340) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.025439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.025925) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.030643) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.040399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.045592) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.046016) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.052235) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.052606) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.062268) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.062704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.071858) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.072294) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.318275) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.318495) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.318495) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.318664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.318664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.318664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.318831) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.318831) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.318831) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.318994) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.318994) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_USub_Invert, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -210,7 +210,7 @@
"user_id": post.posted_by_id,
"profile_pic": post.posted_by.profile_pic
},
- "posted_at": str(post.posted_at)[:-6],
+ "posted_at": str(post.posted_at)[:~6],
"post_content": post.content,
"reactions": {
"count": post.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................................FFF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_comments_return_empty_list _______________
user = <User: User object (1)>
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_comments_return_empty_list(user):
#Arrange
create_post(1,"happy birthday")
#Act
a=get_post(1)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'sharmila',
'user_id': 1,
'profile_pic': 'www.google.com'
},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []
},
'comments': [],
'comments_count': 0
}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-04-20 10:39:07.51015'} != {'posted_at': '2020-04-20 10:39:07.510158'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:460: AssertionError
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-04-20 10:39:07.51038'} != {'posted_at': '2020-04-20 10:39:07.510383'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-04-20 10:39:07.51056'} != {'posted_at': '2020-04-20 10:39:07.510560'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:39:07.51073', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:39:07.510738', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic'...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.860680) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.873806) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.932880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.934815) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.948224) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.509738) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.967601) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.968404) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.969998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.974554) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.975693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.977199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.991396) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.009595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.028260) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.509834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.048363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.048855) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.068400) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.068873) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.509882) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.097534) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.098043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.115588) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.116100) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.134479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.135114) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.509982) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.154840) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.155321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.155823) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.174993) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.175446) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.175928) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.510031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.196728) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.197213) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.197741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.198268) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.203021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.203494) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.209704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.210205) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.210682) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.216828) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.217297) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.222104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.231970) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.236979) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.237422) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.244197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.244612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.253687) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.254068) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.262598) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.263048) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.510158) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.510383) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.510383) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.510560) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.510560) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.510560) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.510738) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.510738) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.510738) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.510906) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.510906) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_comments_return_empty_list - A...
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 4 failed, 43 passed, 67 warnings in 1.19s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_USub_Invert, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -264,7 +264,7 @@
user_dict["name"]=i.commented_by.name
user_dict["profile_pic"]=i.commented_by.profile_pic
comment_dict["commenter"]=user_dict
- comment_dict["commented_at"]=str(i.commented_at)[:-6]
+ comment_dict["commented_at"]=str(i.commented_at)[:~6]
comment_dict["comment_content"]=i.content
comment_list.append(comment_dict)
comment_dict={}============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................................F [100%]
=================================== FAILURES ===================================
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
e=reply_to_comment(d.id,b, "Thanks for ur wishes")
#Assert
> assert get_replies_for_comment(b)== [{
"comment_id": 2,
"commenter": {
"user_id": 1,
"name": "srinu",
"profile_pic": "www.facebook.com"
},
"commented_at": str(datetime.now()),
"comment_content": "Thanks for ur wishes",
}]
E AssertionError: assert [{'comment_co...user_id': 1}}] == [{'comment_co...user_id': 1}}]
E At index 0 diff: {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:48.03068', 'comment_content': 'Thanks for ur wishes'} != {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:48.030685', 'comment_content': 'Thanks for ur wishes'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:621: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.386897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.400497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.461083) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.463061) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.477636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.029545) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.497744) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.498670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.500377) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.505253) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.506435) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.508049) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.523860) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.543249) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.562573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.029655) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.583450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.583954) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.605046) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.605552) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.029700) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.635568) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.636045) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.654659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.655158) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.673813) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.674476) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.029786) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.695237) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.695727) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.696255) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.716590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.717086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.717615) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.029827) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.738375) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.738857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.739369) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.739874) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.744722) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.745196) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.751330) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.751808) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.752284) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.758453) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.758926) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.763700) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.773642) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.778981) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.779414) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.786391) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.786823) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.796866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.797301) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.806588) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.807023) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.029971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.030195) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.030195) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.030362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.030362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.030362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.030528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.030528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.030528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.030685) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.030685) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 1 failed, 46 passed, 67 warnings in 1.11s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_USub_Not, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -176,7 +176,7 @@
"name": reply.commented_by.name,
"profile_pic": reply.commented_by.profile_pic
},
- "commented_at": str(reply.commented_at)[:-6],
+ "commented_at": str(reply.commented_at)[:not 6],
"comment_content": reply.content,
"reactions": {
"count": reply.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..........................................F.F.. [100%]
=================================== FAILURES ===================================
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:09.650781', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:09.650781', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:39:09.650951', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:39:09.650951', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.002640) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.016572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.076748) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.078651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.092541) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.649980) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.111864) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.112704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.114329) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.118936) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.120090) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.121630) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.136535) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.154950) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.173276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.650081) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.193678) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.194192) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.215132) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.215642) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.650136) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.245974) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.246477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.265760) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.266282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.285369) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.286020) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.650218) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.307029) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.307524) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.308039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.329001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.329506) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.330047) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.650261) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.351300) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.351785) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.352305) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.352809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.357662) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.358160) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.364335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.364814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.365289) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.371501) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.371978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.376824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.386751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.391995) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.392412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.398914) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.399296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.408238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.408635) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.417007) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.417439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.650392) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.650614) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.650614) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.650781) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.650781) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.650781) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.650951) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.650951) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.650951) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.651117) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.651117) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 2 failed, 45 passed, 67 warnings in 1.12s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_USub_Not, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -192,7 +192,7 @@
"name": comment.commented_by.name,
"profile_pic": comment.commented_by.profile_pic
},
- "commented_at": str(comment.commented_at)[:-6],
+ "commented_at": str(comment.commented_at)[:not 6],
"comment_content": comment.content,
"reactions": {
"count": comment.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:58.028973', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:58.029141', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:58.029317', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'c...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.372416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.385616) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.443954) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.445774) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.459730) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.028337) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.478879) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.479695) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.481264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.486838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.487948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.489443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.502693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.521011) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.539389) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.028438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.559637) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.560127) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.580489) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.580988) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.028491) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.611612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.612125) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.631714) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.632232) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.651673) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.652326) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.028577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.673086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.673549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.674079) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.695043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.695553) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.696073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.028623) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.716893) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.717362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.717865) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.718380) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.723059) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.723518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.729488) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.729974) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.730440) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.736382) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.736833) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.741439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.751127) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.756472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.756916) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.763881) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.764322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.774492) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.774930) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.784165) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.784589) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.028749) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.028973) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.028973) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.029141) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.029141) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.029141) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.029317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.029317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.029317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.029486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.029486) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_USub_Not, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -210,7 +210,7 @@
"user_id": post.posted_by_id,
"profile_pic": post.posted_by.profile_pic
},
- "posted_at": str(post.posted_at)[:-6],
+ "posted_at": str(post.posted_at)[:not 6],
"post_content": post.content,
"reactions": {
"count": post.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................................FFF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_comments_return_empty_list _______________
user = <User: User object (1)>
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_comments_return_empty_list(user):
#Arrange
create_post(1,"happy birthday")
#Act
a=get_post(1)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'sharmila',
'user_id': 1,
'profile_pic': 'www.google.com'
},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []
},
'comments': [],
'comments_count': 0
}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': ''} != {'posted_at': '2020-04-20 10:39:11.724582'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:460: AssertionError
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': ''} != {'posted_at': '2020-04-20 10:39:11.724812'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': ''} != {'posted_at': '2020-04-20 10:39:11.724978'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:39:11.725150', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'c...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.077254) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.089827) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.150939) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.152882) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.167439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.724164) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.186947) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.187761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.189325) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.193778) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.194921) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.196474) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.211097) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.229700) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.248109) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.724271) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.267782) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.268231) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.288254) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.288747) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.724321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.318038) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.318540) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.337434) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.337958) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.356837) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.357477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.724410) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.377585) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.378069) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.378597) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.398561) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.399059) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.399573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.724455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.420104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.420572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.421065) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.421543) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.426187) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.426631) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.432559) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.433035) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.433493) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.439584) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.440062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.444897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.454676) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.459627) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.460032) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.466701) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.467126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.476691) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.477094) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.485839) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.486297) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.724582) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.724812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.724812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.724978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.724978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.724978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.725150) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.725150) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.725150) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.725321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.725321) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_comments_return_empty_list - A...
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 4 failed, 43 passed, 67 warnings in 1.15s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_USub_Not, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -264,7 +264,7 @@
user_dict["name"]=i.commented_by.name
user_dict["profile_pic"]=i.commented_by.profile_pic
comment_dict["commenter"]=user_dict
- comment_dict["commented_at"]=str(i.commented_at)[:-6]
+ comment_dict["commented_at"]=str(i.commented_at)[:not 6]
comment_dict["comment_content"]=i.content
comment_list.append(comment_dict)
comment_dict={}============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................................F [100%]
=================================== FAILURES ===================================
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
e=reply_to_comment(d.id,b, "Thanks for ur wishes")
#Assert
> assert get_replies_for_comment(b)== [{
"comment_id": 2,
"commenter": {
"user_id": 1,
"name": "srinu",
"profile_pic": "www.facebook.com"
},
"commented_at": str(datetime.now()),
"comment_content": "Thanks for ur wishes",
}]
E AssertionError: assert [{'comment_co...user_id': 1}}] == [{'comment_co...user_id': 1}}]
E At index 0 diff: {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '', 'comment_content': 'Thanks for ur wishes'} != {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:39.568796', 'comment_content': 'Thanks for ur wishes'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:621: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.921484) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.934910) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.994948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.996926) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.010531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.567634) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.029817) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.030648) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.032224) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.036706) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.037819) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.039380) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.053589) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.072073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.090488) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.567745) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.110542) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.111010) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.131236) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.131709) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.567792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.160820) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.161343) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.179648) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.180143) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.198810) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.199437) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.567878) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.220416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.220899) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.221429) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.241687) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.242191) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.242723) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.567925) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.263101) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.263589) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.264119) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.264616) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.269266) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.269724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.275610) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.276066) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.276518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.282399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.282869) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.287683) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.297128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.302055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.302468) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.309162) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.309591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.319640) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.320076) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.329111) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.329554) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.568054) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.568290) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.568290) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.568462) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.568462) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.568462) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.568632) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.568632) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.568632) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.568796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.568796) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 1 failed, 46 passed, 67 warnings in 1.09s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_USub, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -176,7 +176,7 @@
"name": reply.commented_by.name,
"profile_pic": reply.commented_by.profile_pic
},
- "commented_at": str(reply.commented_at)[:-6],
+ "commented_at": str(reply.commented_at)[:6],
"comment_content": reply.content,
"reactions": {
"count": reply.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..........................................F.F.. [100%]
=================================== FAILURES ===================================
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:46.109996', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:46.109996', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:46.110171', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:46.110171', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.455201) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.468217) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.524407) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.526377) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.539760) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.109175) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.558463) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.560482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.562093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.566644) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.567752) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.569281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.584086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.602332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.621404) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.109281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.642043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.642550) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.663272) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.663795) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.109328) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.693735) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.694274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.712998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.713487) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.732439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.733101) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.109410) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.753732) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.754249) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.754772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.775280) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.775794) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.776330) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.109458) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.797487) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.797950) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.798431) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.798883) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.803264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.803692) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.809818) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.810339) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.810820) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.817075) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.817550) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.822423) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.832278) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.837581) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.838039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.845030) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.845473) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.855675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.856132) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.865428) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.865886) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.109587) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.109807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.109807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.109996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.109996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.109996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.110171) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.110171) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.110171) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.110339) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.110339) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 2 failed, 45 passed, 67 warnings in 1.12s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_USub, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -192,7 +192,7 @@
"name": comment.commented_by.name,
"profile_pic": comment.commented_by.profile_pic
},
- "commented_at": str(comment.commented_at)[:-6],
+ "commented_at": str(comment.commented_at)[:6],
"comment_content": comment.content,
"reactions": {
"count": comment.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-0', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:03.082152', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-0', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:03.082320', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:39:03.082489', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-0', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.438897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.453343) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.514147) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.516101) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.530362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.081506) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.549766) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.550607) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.552151) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.556620) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.557743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.559281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.572993) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.590392) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.609393) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.081612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.629791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.630284) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.651011) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.651505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.081668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.681526) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.682057) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.700574) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.701057) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.719323) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.719905) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.081754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.739932) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.740380) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.740867) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.760248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.760707) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.761199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.081798) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.781608) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.782114) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.782621) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.783112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.787848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.788300) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.794066) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.794514) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.794957) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.800654) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.801092) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.805716) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.815574) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.820741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.821176) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.828055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.828472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.837935) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.838341) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.847045) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.847470) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.081936) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.082152) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.082152) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.082320) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.082320) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.082320) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.082489) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.082489) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.082489) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.082657) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.082657) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.14s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_USub, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -210,7 +210,7 @@
"user_id": post.posted_by_id,
"profile_pic": post.posted_by.profile_pic
},
- "posted_at": str(post.posted_at)[:-6],
+ "posted_at": str(post.posted_at)[:6],
"post_content": post.content,
"reactions": {
"count": post.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................................FFF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_comments_return_empty_list _______________
user = <User: User object (1)>
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_comments_return_empty_list(user):
#Arrange
create_post(1,"happy birthday")
#Act
a=get_post(1)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'sharmila',
'user_id': 1,
'profile_pic': 'www.google.com'
},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []
},
'comments': [],
'comments_count': 0
}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-0'} != {'posted_at': '2020-04-20 10:39:19.171558'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:460: AssertionError
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-0'} != {'posted_at': '2020-04-20 10:39:19.171796'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-0'} != {'posted_at': '2020-04-20 10:39:19.171953'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-0', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:39:19.172112', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.527822) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.541459) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.598934) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.600877) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.615220) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.171137) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.635754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.636624) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.638295) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.644078) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.645258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.646916) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.661235) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.680925) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.700549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.171240) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.721921) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.722440) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.743976) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.744477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.171291) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.773724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.774233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.792517) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.792999) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.811626) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.812248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.171379) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.832911) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.833389) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.833931) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.853610) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.854113) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.854629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.171427) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.874923) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.875398) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.875899) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.876391) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.880985) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.881430) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.887241) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.887688) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.888136) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.894095) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.894552) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.899230) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.908450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.913402) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.913840) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.920634) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.921051) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.930417) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.930825) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.939678) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.940108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.171558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.171796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.171796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.171953) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.171953) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.171953) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.172112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.172112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.172112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.172274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.172274) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_comments_return_empty_list - A...
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 4 failed, 43 passed, 67 warnings in 1.15s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_USub, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -264,7 +264,7 @@
user_dict["name"]=i.commented_by.name
user_dict["profile_pic"]=i.commented_by.profile_pic
comment_dict["commenter"]=user_dict
- comment_dict["commented_at"]=str(i.commented_at)[:-6]
+ comment_dict["commented_at"]=str(i.commented_at)[:6]
comment_dict["comment_content"]=i.content
comment_list.append(comment_dict)
comment_dict={}============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................................F [100%]
=================================== FAILURES ===================================
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
e=reply_to_comment(d.id,b, "Thanks for ur wishes")
#Assert
> assert get_replies_for_comment(b)== [{
"comment_id": 2,
"commenter": {
"user_id": 1,
"name": "srinu",
"profile_pic": "www.facebook.com"
},
"commented_at": str(datetime.now()),
"comment_content": "Thanks for ur wishes",
}]
E AssertionError: assert [{'comment_co...user_id': 1}}] == [{'comment_co...user_id': 1}}]
E At index 0 diff: {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-0', 'comment_content': 'Thanks for ur wishes'} != {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:40.676862', 'comment_content': 'Thanks for ur wishes'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:621: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.026078) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.039896) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.099473) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.101379) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.114496) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.675749) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.133479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.134306) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.135846) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.140177) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.141228) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.142786) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.157885) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.176663) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.195698) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.675860) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.216025) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.216504) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.236898) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.237397) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.675903) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.267178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.267661) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.286059) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.286523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.304801) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.305423) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.675989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.325857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.326355) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.326863) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.346880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.347362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.347877) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.676029) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.368478) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.368948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.369452) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.369956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.374572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.375014) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.380701) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.381160) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.381612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.387498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.387960) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.392550) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.401837) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.406880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.407305) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.414020) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.414458) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.424284) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.424722) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.433792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.434256) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.676161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.676389) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.676389) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.676548) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.676548) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.676548) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.676705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.676705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.676705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.676862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.676862) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 1 failed, 46 passed, 67 warnings in 1.09s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -7,7 +7,7 @@
from datetime import datetime
#task 2
def create_post(user_id, post_content):
- if not User.objects.filter(id=user_id).exists():
+ if User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not post_content:
raise InvalidPostContent============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py FEFF.....................................FFF.F.F [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_create_post_user_id_raises_invalid_user_exception __
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7f0f76ca9828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_post' with primary key '1' has an invalid foreign key: fb_post_post.posted_by_id contains a value '1' that does not have a corresponding value in fb_post_user.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
____________ test_create_post_user_id_raises_invalid_user_exception ____________
@pytest.mark.django_db
def test_create_post_user_id_raises_invalid_user_exception():
#Arrange
id_one=1
#Act
with pytest.raises(InvalidUserException):
> create_post(id_one,"hiii how are you")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidUserException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:63: Failed
________ test_create_post_content_raises_invalid_post_content_exception ________
user = <User: User object (1)>
@pytest.mark.django_db
def test_create_post_content_raises_invalid_post_content_exception(user):
#Arrange
id_one=1
#Act
with pytest.raises(InvalidPostContent):
> create_post(id_one,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:72:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = ''
def create_post(user_id, post_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
_______________ test_create_post_valid_user_id_and_post_content ________________
user = <User: User object (1)>
@pytest.mark.django_db
def test_create_post_valid_user_id_and_post_content(user):
#Arrange
id_one=1
#Act
> post_1=create_post(id_one,"hello guys")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'hello guys'
def create_post(user_id, post_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
_______________ test_get_post_with_no_comments_return_empty_list _______________
user = <User: User object (1)>
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_comments_return_empty_list(user):
#Arrange
> create_post(1,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:456:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:483:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:566:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:616:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.861943) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.052848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.111706) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.113486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.126750) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.519884) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.146011) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.146813) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.148472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.152828) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.153935) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.155441) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.168956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.187187) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.205399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.519994) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.225684) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.226155) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.245757) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.246259) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.520042) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.274667) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.275125) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.293416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.293898) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.312007) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.312491) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.520125) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.332531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.333130) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.333633) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.353845) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.354352) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.354867) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.520163) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.375356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.375824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.376321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.376798) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.381725) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.382210) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.388279) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.388739) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.389189) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.394940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.395377) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.399834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.409351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.414187) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.414580) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.421132) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.421549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.431327) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.431754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.441416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.441828) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_create_post_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_create_post_content_raises_invalid_post_content_exception
FAILED fb_post/tests.py::test_create_post_valid_user_id_and_post_content - fb...
FAILED fb_post/tests.py::test_get_post_with_no_comments_return_empty_list - f...
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - fb...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
ERROR fb_post/tests.py::test_create_post_user_id_raises_invalid_user_exception
============== 8 failed, 39 passed, 56 warnings, 1 error in 1.28s ==============
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -9,7 +9,7 @@
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
- if not post_content:
+ if post_content:
raise InvalidPostContent
new_post=Post.objects.create(content=post_content,posted_by_id=user_id,posted_at=datetime.now())============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .FF.....................................FFF.F.F [100%]
=================================== FAILURES ===================================
________ test_create_post_content_raises_invalid_post_content_exception ________
user = <User: User object (1)>
@pytest.mark.django_db
def test_create_post_content_raises_invalid_post_content_exception(user):
#Arrange
id_one=1
#Act
with pytest.raises(InvalidPostContent):
> create_post(id_one,"")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidPostContent'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:72: Failed
_______________ test_create_post_valid_user_id_and_post_content ________________
user = <User: User object (1)>
@pytest.mark.django_db
def test_create_post_valid_user_id_and_post_content(user):
#Arrange
id_one=1
#Act
> post_1=create_post(id_one,"hello guys")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'hello guys'
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if post_content:
> raise InvalidPostContent
E fb_post.exceptions.InvalidPostContent
fb_post/utils.py:13: InvalidPostContent
_______________ test_get_post_with_no_comments_return_empty_list _______________
user = <User: User object (1)>
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_comments_return_empty_list(user):
#Arrange
> create_post(1,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:456:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if post_content:
> raise InvalidPostContent
E fb_post.exceptions.InvalidPostContent
fb_post/utils.py:13: InvalidPostContent
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:483:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if post_content:
> raise InvalidPostContent
E fb_post.exceptions.InvalidPostContent
fb_post/utils.py:13: InvalidPostContent
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if post_content:
> raise InvalidPostContent
E fb_post.exceptions.InvalidPostContent
fb_post/utils.py:13: InvalidPostContent
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:566:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if post_content:
> raise InvalidPostContent
E fb_post.exceptions.InvalidPostContent
fb_post/utils.py:13: InvalidPostContent
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:616:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if post_content:
> raise InvalidPostContent
E fb_post.exceptions.InvalidPostContent
fb_post/utils.py:13: InvalidPostContent
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_content_raises_invalid_post_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.806780) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.919856) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.980419) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.982375) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.996116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.460675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.015505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.016354) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.017971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.022622) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.023755) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.025266) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.039152) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.057638) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.076025) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.460780) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.096414) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.096903) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.117829) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.118361) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.460823) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.149009) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.149507) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.168684) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.169211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.188816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.189500) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.460903) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.211091) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.211616) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.212157) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.233129) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.233625) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.234187) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.460942) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.255274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.255758) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.256263) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.256754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.261568) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.262075) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.268421) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.268905) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.269379) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.275639) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.276128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.281123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.290942) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.296896) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.297314) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.304169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.304612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.314816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.315285) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.324782) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.325222) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_create_post_content_raises_invalid_post_content_exception
FAILED fb_post/tests.py::test_create_post_valid_user_id_and_post_content - fb...
FAILED fb_post/tests.py::test_get_post_with_no_comments_return_empty_list - f...
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - fb...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 7 failed, 40 passed, 56 warnings in 1.18s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -16,7 +16,7 @@
return new_post.id
#task 3
def create_comment(user_id, post_id, comment_content):
- if not User.objects.filter(id=user_id).exists():
+ if User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...FFFF..................................FF.F.F [100%]
=================================== FAILURES ===================================
__________ test_create_comment_user_id_raises_invalid_user_exception ___________
@pytest.mark.django_db
def test_create_comment_user_id_raises_invalid_user_exception():
#Arrange
id_one=1
id_two=2
#Act
with pytest.raises(InvalidUserException):
> create_comment(id_one,id_two,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 2, comment_content = 'hiii how are you'
def create_comment(user_id, post_id, comment_content):
if User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
__________ test_create_comment_post_id_raises_invalid_post_exception ___________
user = <User: User object (1)>
@pytest.mark.django_db
def test_create_comment_post_id_raises_invalid_post_exception(user):
#Arrange
id_one=1
id_two=2
#Act
with pytest.raises(InvalidPostException):
> create_comment(id_one,id_two,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 2, comment_content = 'hiii how are you'
def create_comment(user_id, post_id, comment_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
_____ test_create_comment_content_raises_invalid_comment_content_exception _____
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_create_comment_content_raises_invalid_comment_content_exception(user,post):
#Arrange
id_one=1
#Act
with pytest.raises(InvalidCommentContent):
> create_comment(id_one,id_one,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = ''
def create_comment(user_id, post_id, comment_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
_________ test_create_comment_valid_user_post_ids_and_comment_content __________
user2 = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_create_comment_valid_user_post_ids_and_comment_content(user2,post):
#Arrange
id_one=1
#Act
> comment_1=create_comment(user2.id,post.id,"Thank you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:121:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'Thank you'
def create_comment(user_id, post_id, comment_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:484:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:518:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:567:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:617:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.095618) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.213809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.291821) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.325477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.736754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.345132) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.345984) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.347573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.352066) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.353197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.354765) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.368615) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.387343) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.405297) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.736850) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.425834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.426344) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.447036) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.447521) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.736884) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.477940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.478427) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.496919) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.497401) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.515923) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.516426) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.736954) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.537030) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.537659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.538201) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.558801) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.559301) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.559834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.736991) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.581451) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.581969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.582499) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.582996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.588129) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.588610) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.594935) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.595412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.595872) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.601952) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.602455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.607261) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.616923) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.621875) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.622313) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.629555) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.629988) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.639216) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.639612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.648277) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.648706) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.737107) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.737317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.737456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.737583) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.737706) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_create_comment_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_create_comment_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
FAILED fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - fb...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 8 failed, 39 passed, 60 warnings in 1.21s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -18,7 +18,7 @@
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
- if not Post.objects.filter(id=post_id).exists():
+ if Post.objects.filter(id=post_id).exists():
raise InvalidPostException
if not comment_content:
raise InvalidCommentContent============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ....FEFF..................................FF.F.F [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_create_comment_post_id_raises_invalid_post_exception _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7ff95b45a828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.post_id contains a value '2' that does not have a corresponding value in fb_post_post.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
__________ test_create_comment_post_id_raises_invalid_post_exception ___________
user = <User: User object (1)>
@pytest.mark.django_db
def test_create_comment_post_id_raises_invalid_post_exception(user):
#Arrange
id_one=1
id_two=2
#Act
with pytest.raises(InvalidPostException):
> create_comment(id_one,id_two,"hiii how are you")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidPostException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:104: Failed
_____ test_create_comment_content_raises_invalid_comment_content_exception _____
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_create_comment_content_raises_invalid_comment_content_exception(user,post):
#Arrange
id_one=1
#Act
with pytest.raises(InvalidCommentContent):
> create_comment(id_one,id_one,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = ''
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
_________ test_create_comment_valid_user_post_ids_and_comment_content __________
user2 = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_create_comment_valid_user_post_ids_and_comment_content(user2,post):
#Arrange
id_one=1
#Act
> comment_1=create_comment(user2.id,post.id,"Thank you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:121:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'Thank you'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:484:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:518:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:567:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:617:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.827159) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_post_id_raises_invalid_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.837393) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.977339) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.057527) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.089479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.469963) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.107976) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.108804) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.110372) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.115053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.116261) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.117796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.131207) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.149151) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.166629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.470073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.187079) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.187545) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.207759) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.208244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.470116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.238357) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.238870) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.258051) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.258541) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.277208) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.277698) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.470199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.297958) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.298554) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.299086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.319480) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.319987) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.320532) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.470240) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.341439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.341949) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.342462) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.342981) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.348112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.348630) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.354850) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.355328) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.355808) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.361878) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.362377) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.367221) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.377007) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.382199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.382634) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.389695) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.390136) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.399890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.400327) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.410435) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.410865) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.470370) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.470598) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.470775) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.470948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.471119) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_create_comment_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
FAILED fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - fb...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
ERROR fb_post/tests.py::test_create_comment_post_id_raises_invalid_post_exception
============== 7 failed, 40 passed, 61 warnings, 1 error in 1.25s ==============
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 4
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -20,7 +20,7 @@
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
- if not comment_content:
+ if comment_content:
raise InvalidCommentContent
new_comment=Comment.objects.create(content=comment_content,
commented_by_id=user_id,============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .....FF..................................FF.F.F [100%]
=================================== FAILURES ===================================
_____ test_create_comment_content_raises_invalid_comment_content_exception _____
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_create_comment_content_raises_invalid_comment_content_exception(user,post):
#Arrange
id_one=1
#Act
with pytest.raises(InvalidCommentContent):
> create_comment(id_one,id_one,"")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidCommentContent'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:113: Failed
_________ test_create_comment_valid_user_post_ids_and_comment_content __________
user2 = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_create_comment_valid_user_post_ids_and_comment_content(user2,post):
#Arrange
id_one=1
#Act
> comment_1=create_comment(user2.id,post.id,"Thank you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:121:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'Thank you'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
if comment_content:
> raise InvalidCommentContent
E fb_post.exceptions.InvalidCommentContent
fb_post/utils.py:24: InvalidCommentContent
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:484:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
if comment_content:
> raise InvalidCommentContent
E fb_post.exceptions.InvalidCommentContent
fb_post/utils.py:24: InvalidCommentContent
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:518:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
if comment_content:
> raise InvalidCommentContent
E fb_post.exceptions.InvalidCommentContent
fb_post/utils.py:24: InvalidCommentContent
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:567:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
if comment_content:
> raise InvalidCommentContent
E fb_post.exceptions.InvalidCommentContent
fb_post/utils.py:24: InvalidCommentContent
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:617:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
if comment_content:
> raise InvalidCommentContent
E fb_post.exceptions.InvalidCommentContent
fb_post/utils.py:24: InvalidCommentContent
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.179244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.193053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.831558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.335206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.368619) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.831632) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.388041) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.388862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.390416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.394792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.395914) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.397464) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.411430) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.430196) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.449289) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.831755) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.470478) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.470974) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.491140) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.491629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.831805) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.521748) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.522264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.541704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.542238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.561521) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.562041) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.831895) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.583200) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.583820) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.584348) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.605177) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.605679) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.606223) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.831945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.627620) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.628126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.628656) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.629162) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.634323) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.634795) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.641082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.641590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.642088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.648291) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.648774) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.653743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.664774) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.670175) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.670627) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.677777) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.678244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.688336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.688767) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.698086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.698531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.832105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.832349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.832518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.832684) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.832852) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
FAILED fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - fb...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 6 failed, 41 passed, 61 warnings in 1.17s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 5
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -33,7 +33,7 @@
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
- if not user:
+ if user:
raise InvalidUserException
if not comment:
raise InvalidCommentException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .......FFFFFE..............................F.F.F [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7f4699ec6828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.parent_comment_id contains a value '2' that does not have a corresponding value in fb_post_comment.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
_________ test_reply_to_comment_user_id_raises_invalid_user_exception __________
@pytest.mark.django_db
def test_reply_to_comment_user_id_raises_invalid_user_exception():
#Arrange
id_two=2
#Act
with pytest.raises(InvalidUserException):
> reply_to_comment(id_two,id_two,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:133:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 2, comment_id = 2, reply_content = 'hiii how are you'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if user:
raise InvalidUserException
if not comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
______ test_reply_to_comment_comment_id_raises_invalid_comment_exception _______
user = <User: User object (1)>
@pytest.mark.django_db
def test_reply_to_comment_comment_id_raises_invalid_comment_exception(user):
#Arrange
id_one=1
id_two=2
#Act
with pytest.raises(InvalidCommentException):
> reply_to_comment(id_one,id_two,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:143:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 2, reply_content = 'hiii how are you'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
_ test_reply_to_comment_comment_content_raises_invalid_reply_content_exception _
user2 = <User: User object (1)>, post = <Post: Post object (1)>
user = <User: User object (2)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_reply_to_comment_comment_content_raises_invalid_reply_content_exception(user2,post,user):
#Arrange
Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user2.id,post_id=post.id)
#Act
with pytest.raises(InvalidReplyContent):
> reply_to_comment(1,1,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:153:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = ''
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id(user,post):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'welcome'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
user2 = <User: User object (2)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id(user,post,user2):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id,parent_comment_id=user2.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'welcome'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:519:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:568:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> e=reply_to_comment(d.id,b, "Thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:619:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'Thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.755433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.770128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.829649) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.831514) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.948025) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.399966) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.985994) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.986876) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.010878) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.012011) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.103671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.121986) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.139994) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.400071) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.159771) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.160231) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.179977) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.180450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.400112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.209382) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.209835) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.228340) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.228818) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.246941) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.247536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.400193) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.267311) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.267754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.268242) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.287523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.287977) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.288468) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.400231) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.308561) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.309014) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.309512) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.309999) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.314791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.315255) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.321279) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.321761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.322253) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.328515) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.328993) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.333814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.343626) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.348865) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.349298) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.356433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.356883) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.367786) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.368216) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.377312) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.377721) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.400356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.400569) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.400569) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.400722) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.400722) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.400873) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.400873) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.401023) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.401023) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_reply_to_comment_comment_id_raises_invalid_comment_exception
FAILED fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
ERROR fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
============== 8 failed, 39 passed, 63 warnings, 1 error in 1.30s ==============
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 6
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -35,7 +35,7 @@
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
- if not comment:
+ if comment:
raise InvalidCommentException
if not reply_content:
raise InvalidReplyContent============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........FFFFE..............................F.F.F [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7f8b2b83e828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.parent_comment_id contains a value '2' that does not have a corresponding value in fb_post_comment.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
______ test_reply_to_comment_comment_id_raises_invalid_comment_exception _______
user = <User: User object (1)>
@pytest.mark.django_db
def test_reply_to_comment_comment_id_raises_invalid_comment_exception(user):
#Arrange
id_one=1
id_two=2
#Act
with pytest.raises(InvalidCommentException):
> reply_to_comment(id_one,id_two,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:143:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:42: in reply_to_comment
if comment[0].parent_comment_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
_ test_reply_to_comment_comment_content_raises_invalid_reply_content_exception _
user2 = <User: User object (1)>, post = <Post: Post object (1)>
user = <User: User object (2)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_reply_to_comment_comment_content_raises_invalid_reply_content_exception(user2,post,user):
#Arrange
Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user2.id,post_id=post.id)
#Act
with pytest.raises(InvalidReplyContent):
> reply_to_comment(1,1,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:153:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = ''
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id(user,post):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'welcome'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
user2 = <User: User object (2)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id(user,post,user2):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id,parent_comment_id=user2.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'welcome'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:519:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:568:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> e=reply_to_comment(d.id,b, "Thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:619:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'Thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.714474) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.728323) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.788415) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.790456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.931940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.359835) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.970332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.971194) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.994822) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.996009) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.089556) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.108580) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.126470) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.359943) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.146774) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.147282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.167602) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.168130) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.360000) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.198384) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.198906) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.218738) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.219258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.237797) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.238579) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.360090) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.260647) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.261174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.261728) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.283384) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.283942) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.284497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.360140) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.306816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.307357) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.307913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.308467) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.313380) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.313891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.320856) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.321392) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.321877) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.328275) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.328774) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.333803) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.344096) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.349344) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.349791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.356681) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.357113) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.367244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.367686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.377106) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.377557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.360272) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.360494) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.360494) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.360656) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.360656) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.360817) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.360817) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.360975) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.360975) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_comment_id_raises_invalid_comment_exception
FAILED fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
ERROR fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
============== 7 failed, 40 passed, 63 warnings, 1 error in 1.37s ==============
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 7
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -37,7 +37,7 @@
raise InvalidUserException
if not comment:
raise InvalidCommentException
- if not reply_content:
+ if reply_content:
raise InvalidReplyContent
if comment[0].parent_comment_id:
reply_comment=Comment.objects.create(content=reply_content,============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........FFFE..............................F.F.F [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7f75a357e828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.parent_comment_id contains a value '2' that does not have a corresponding value in fb_post_comment.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
_ test_reply_to_comment_comment_content_raises_invalid_reply_content_exception _
user2 = <User: User object (1)>, post = <Post: Post object (1)>
user = <User: User object (2)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_reply_to_comment_comment_content_raises_invalid_reply_content_exception(user2,post,user):
#Arrange
Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user2.id,post_id=post.id)
#Act
with pytest.raises(InvalidReplyContent):
> reply_to_comment(1,1,"")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidReplyContent'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:153: Failed
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id(user,post):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'welcome'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not comment:
raise InvalidCommentException
if reply_content:
> raise InvalidReplyContent
E fb_post.exceptions.InvalidReplyContent
fb_post/utils.py:41: InvalidReplyContent
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
user2 = <User: User object (2)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id(user,post,user2):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id,parent_comment_id=user2.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'welcome'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not comment:
raise InvalidCommentException
if reply_content:
> raise InvalidReplyContent
E fb_post.exceptions.InvalidReplyContent
fb_post/utils.py:41: InvalidReplyContent
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:519:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not comment:
raise InvalidCommentException
if reply_content:
> raise InvalidReplyContent
E fb_post.exceptions.InvalidReplyContent
fb_post/utils.py:41: InvalidReplyContent
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:568:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not comment:
raise InvalidCommentException
if reply_content:
> raise InvalidReplyContent
E fb_post.exceptions.InvalidReplyContent
fb_post/utils.py:41: InvalidReplyContent
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> e=reply_to_comment(d.id,b, "Thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:619:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'Thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not comment:
raise InvalidCommentException
if reply_content:
> raise InvalidReplyContent
E fb_post.exceptions.InvalidReplyContent
fb_post/utils.py:41: InvalidReplyContent
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.251128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.264526) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.324981) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.326948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.340772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.897725) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.439969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.440861) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.465324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.466542) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.558308) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.577285) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.596273) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.897841) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.616596) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.617074) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.637521) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.638030) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.897891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.667662) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.668135) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.686501) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.686963) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.705273) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.705927) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.897996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.725817) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.726318) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.726815) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.746418) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.746876) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.747370) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.898044) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.767147) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.767594) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.768076) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.768544) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.773070) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.773540) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.779399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.779874) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.780335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.786183) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.786638) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.791265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.801245) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.806325) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.806746) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.813640) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.814111) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.823843) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.824298) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.833535) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.834019) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.898171) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.898394) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.898394) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.898568) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.898568) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.898737) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.898737) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.898905) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.898905) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
ERROR fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
============== 6 failed, 41 passed, 63 warnings, 1 error in 1.24s ==============
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 8
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -58,7 +58,7 @@
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
- if not user_1:
+ if user_1:
raise InvalidUserException
if not post_1:
raise InvalidPostException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............FFFFFFF.......................F.F.. [100%]
=================================== FAILURES ===================================
___________ test_react_to_post_user_id_raises_invalid_user_exception ___________
@pytest.mark.django_db
def test_react_to_post_user_id_raises_invalid_user_exception():
#Arrange
#Act
with pytest.raises(InvalidUserException):
> react_to_post(1,2,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:184:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 2, reaction_type = 'hiii how are you'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if user_1:
raise InvalidUserException
if not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
___________ test_react_to_post_post_id_raises_invalid_post_exception ___________
user = <User: User object (1)>
@pytest.mark.django_db
def test_react_to_post_post_id_raises_invalid_post_exception(user):
#Arrange
#Act
with pytest.raises(InvalidPostException):
> react_to_post(1,2,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:192:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 2, reaction_type = 'hiii how are you'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
_ test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field _
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field(user,post):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_post(1,1,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:200:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = ''
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
_ test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field _
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field(user,post):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_post(1,1,"HELLO")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'HELLO'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
__________ test_react_to_post_valid_reaction_type_for_the_first_time ___________
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_first_time(user,post):
#Arrange
#Act
> react_to_post(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:216:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"LIT")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LIT'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:237:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'WOW'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:520:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:569:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.068088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.082141) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.142232) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.144254) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.158586) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.714489) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.178121) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.178935) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.180519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.185898) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.187071) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.188629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.305123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.343131) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.380884) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.418259) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.418743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.455057) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.455557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.502980) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.503455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.522635) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.523095) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.541532) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.541991) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.714726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.562046) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.562639) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.563168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.583349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.583822) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.584342) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.714772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.604345) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.604758) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.605246) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.605698) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.610313) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.610718) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.616416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.616821) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.617260) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.622856) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.623261) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.627753) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.637361) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.642468) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.642899) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.649683) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.650104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.659191) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.659590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.668617) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.669052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.714898) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.715121) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.715121) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.715287) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.715287) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.715449) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.715449) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.715608) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.715608) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_react_to_post_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
FAILED fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 9 failed, 38 passed, 63 warnings in 1.24s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 9
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -60,7 +60,7 @@
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
- if not post_1:
+ if post_1:
raise InvalidPostException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .............FFFFFF.......................F.F.. [100%]
=================================== FAILURES ===================================
___________ test_react_to_post_post_id_raises_invalid_post_exception ___________
user = <User: User object (1)>
@pytest.mark.django_db
def test_react_to_post_post_id_raises_invalid_post_exception(user):
#Arrange
#Act
with pytest.raises(InvalidPostException):
> react_to_post(1,2,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:192:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 2, reaction_type = 'hiii how are you'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if post_1:
raise InvalidPostException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:66: InvalidReactionTypeException
_ test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field _
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field(user,post):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_post(1,1,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:200:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = ''
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
_ test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field _
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field(user,post):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_post(1,1,"HELLO")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'HELLO'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
__________ test_react_to_post_valid_reaction_type_for_the_first_time ___________
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_first_time(user,post):
#Arrange
#Act
> react_to_post(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:216:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"LIT")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LIT'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:237:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'WOW'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:520:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:569:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.498420) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.512209) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.572483) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.574473) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.588627) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.146997) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.608014) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.608832) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.610445) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.615957) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.617058) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.618624) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.714322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.752097) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.788926) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.825973) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.826487) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.863788) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.864296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.910439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.910944) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.929570) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.930077) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.948307) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.948792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.147231) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.969176) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.969791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.970329) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.990553) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.991027) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.991531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.147274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.011738) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.012193) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.012688) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.013175) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.017892) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.018370) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.024251) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.024715) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.025172) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.030944) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.031399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.036093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.045263) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.050112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.050523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.057285) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.057707) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.067110) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.067539) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.076814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.077220) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.147399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.147627) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.147627) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.147797) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.147797) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.147958) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.147958) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.148116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.148116) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
FAILED fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 8 failed, 39 passed, 63 warnings in 1.22s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 10
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -64,7 +64,7 @@
raise InvalidPostException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException
- if not reaction_2:
+ if reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
if reaction_2[0].reaction==reaction_type:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ................FFF.......................F.F.. [100%]
=================================== FAILURES ===================================
__________ test_react_to_post_valid_reaction_type_for_the_first_time ___________
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_first_time(user,post):
#Arrange
#Act
> react_to_post(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:216:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:70: in react_to_post
if reaction_2[0].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_post(user.id,post.id,"LIT")
#Assert
reaction_1=Reaction.objects.all()
> assert list(reaction_1)==[]
E assert [<Reaction: R...n object (2)>] == []
E Left contains 2 more items, first extra item: <Reaction: Reaction object (1)>
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:229: AssertionError
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_post(user.id,post.id,"WOW")
#Assert
reaction_1=Reaction.objects.all()
> assert reaction_1[0].reaction=="WOW"
E AssertionError: assert 'LIT' == 'WOW'
E - WOW
E + LIT
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:240: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:520:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:70: in react_to_post
if reaction_2[0].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:569:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:70: in react_to_post
if reaction_2[0].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.294376) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.307218) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.365747) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.367572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.380421) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.942066) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.398983) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.399752) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.401266) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.406467) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.407560) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.409031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.422210) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.440422) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.458385) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.597577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.598128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.942202) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.630820) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.631336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.942223) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.673132) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.673625) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.692403) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.692892) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.711588) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.712078) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.942309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.732514) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.733126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.733643) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.753995) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.754482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.754978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.942356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.775433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.775882) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.776360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.776829) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.781446) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.781884) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.787753) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.788222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.788689) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.794704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.795155) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.799738) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.809169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.814163) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.814581) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.821291) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.821697) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.831274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.831693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.840720) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.841149) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.942486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.942707) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.942707) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.942875) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.942875) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.943043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.943043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.943210) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.943210) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 5 failed, 42 passed, 65 warnings in 1.30s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 11
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -81,7 +81,7 @@
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
- if not user_1:
+ if user_1:
raise InvalidUserException
if not comment_1:
raise InvalidCommentException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...................FFFFFFF................F.F.. [100%]
=================================== FAILURES ===================================
_________ test_react_to_comment_user_id_raises_invalid_user_exception __________
@pytest.mark.django_db
def test_react_to_comment_user_id_raises_invalid_user_exception():
#Arrange
#Act
with pytest.raises(InvalidUserException):
> react_to_comment(1,2,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:249:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 2, reaction_type = 'hiii how are you'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if user_1:
raise InvalidUserException
if not comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
_________ test_react_to_comment_post_id_raises_invalid_post_exception __________
user = <User: User object (1)>
@pytest.mark.django_db
def test_react_to_comment_post_id_raises_invalid_post_exception(user):
#Arrange
#Act
with pytest.raises(InvalidCommentException):
> react_to_comment(1,2,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:258:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 2, reaction_type = 'hiii how are you'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
_ test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field(user,comment):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_comment(1,1,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:268:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = ''
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
_ test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field(user,comment):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_comment(1,1,"HELLO")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:278:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'HELLO'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
_________ test_react_to_comment_valid_reaction_type_for_the_first_time _________
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_first_time(user,comment):
#Arrange
#Act
> react_to_comment(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:289:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'LOVE'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:300:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'LOVE'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:311:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:521:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:570:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.940970) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.954608) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.013621) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.015624) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.029767) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.597064) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.049505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.050351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.051943) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.056438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.057589) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.059112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.074131) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.092885) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.111056) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.597169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.131110) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.131606) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.151670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.152164) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.597213) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.280594) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.281126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.318346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.318864) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.355343) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.355850) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.392847) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.393386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.393930) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.431167) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.431682) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.432206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.469544) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.470089) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.470637) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.471162) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.476064) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.476550) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.482932) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.483426) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.483929) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.489794) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.490278) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.494898) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.504245) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.508837) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.509229) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.515409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.515811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.524741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.525176) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.534474) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.534902) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.597465) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.597686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.597686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.597848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.597848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.597848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.598032) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.598032) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.598032) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.598193) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.598193) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_react_to_comment_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
FAILED fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 9 failed, 38 passed, 65 warnings in 1.23s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 12
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -83,7 +83,7 @@
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
- if not comment_1:
+ if comment_1:
raise InvalidCommentException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ....................FFFFFF................F.F.. [100%]
=================================== FAILURES ===================================
_________ test_react_to_comment_post_id_raises_invalid_post_exception __________
user = <User: User object (1)>
@pytest.mark.django_db
def test_react_to_comment_post_id_raises_invalid_post_exception(user):
#Arrange
#Act
with pytest.raises(InvalidCommentException):
> react_to_comment(1,2,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:258:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 2, reaction_type = 'hiii how are you'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if comment_1:
raise InvalidCommentException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:89: InvalidReactionTypeException
_ test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field(user,comment):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_comment(1,1,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:268:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = ''
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
_ test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field(user,comment):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_comment(1,1,"HELLO")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:278:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'HELLO'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
_________ test_react_to_comment_valid_reaction_type_for_the_first_time _________
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_first_time(user,comment):
#Arrange
#Act
> react_to_comment(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:289:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'LOVE'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:300:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'LOVE'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:311:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:521:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:570:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.090867) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.105041) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.165897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.167843) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.181845) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.733201) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.201532) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.202389) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.204000) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.209642) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.210829) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.212402) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.226710) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.245723) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.264714) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.733314) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.285071) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.285566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.304967) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.305444) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.733363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.419807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.420342) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.459140) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.459670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.497124) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.497631) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.535026) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.535551) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.536061) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.574228) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.574742) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.575271) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.612553) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.613080) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.613600) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.614287) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.619101) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.619546) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.625652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.626126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.626575) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.632427) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.632890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.637520) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.647054) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.652039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.652470) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.659295) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.659732) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.670281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.670749) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.679824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.680254) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.733621) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.733868) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.733868) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.734055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.734055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.734055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.734226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.734226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.734226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.734393) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.734393) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
FAILED fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 8 failed, 39 passed, 65 warnings in 1.24s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 13
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -87,7 +87,7 @@
raise InvalidCommentException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException
- if not reaction_2:
+ if reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
if reaction_2[0].reaction==reaction_type:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .......................FFF................F.F.. [100%]
=================================== FAILURES ===================================
_________ test_react_to_comment_valid_reaction_type_for_the_first_time _________
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_first_time(user,comment):
#Arrange
#Act
> react_to_comment(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:289:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:93: in react_to_comment
if reaction_2[0].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_comment(user.id,comment.id,"LOVE")
#Assert
reaction_1=Reaction.objects.all()
> assert list(reaction_1)==[]
E assert [<Reaction: R...n object (2)>] == []
E Left contains 2 more items, first extra item: <Reaction: Reaction object (1)>
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:303: AssertionError
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_comment(user.id,comment.id,"WOW")
#Assert
reaction_1=Reaction.objects.all()
> assert reaction_1[0].reaction=="WOW"
E AssertionError: assert 'LOVE' == 'WOW'
E - WOW
E + LOVE
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:314: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:521:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:93: in react_to_comment
if reaction_2[0].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:570:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:93: in react_to_comment
if reaction_2[0].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.825702) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.840111) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.899789) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.901653) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.915110) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.474105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.934554) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.935359) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.936923) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.942408) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.943578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.945212) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.958986) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.977431) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.996251) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.474211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.016395) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.016852) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.036695) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.037168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.474256) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.066551) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.067052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.085405) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.085865) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.104010) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.104601) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.244285) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.244820) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.245339) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.474358) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.278210) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.278678) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.279177) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.474379) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.311640) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.312128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.312622) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.313108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.317676) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.318138) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.323985) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.324443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.324883) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.330654) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.331110) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.335730) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.344922) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.349954) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.350369) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.356951) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.357345) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.366609) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.367007) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.375893) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.376312) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.474510) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.474728) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.474728) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.474891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.474891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.474891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.475052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.475052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.475052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.475219) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.475219) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 5 failed, 42 passed, 67 warnings in 1.31s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 14
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -104,7 +104,7 @@
#task 8
def get_reaction_metrics(post_id):
post_1=Post.objects.filter(id=post_id)
- if not post_1:
+ if post_1:
raise InvalidPostException
a=Reaction.objects.filter(post_id=post_id).values_list("reaction").annotate(Count("reaction"))
return dict(a)============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...........................FFF................. [100%]
=================================== FAILURES ===================================
_________________ test_get_reaction_metrics_for_given_post_id __________________
post = <Post: Post object (1)>, reaction2 = <Reaction: Reaction object (1)>
@pytest.mark.django_db
def test_get_reaction_metrics_for_given_post_id(post,reaction2):
#Arrange
#Act
> a=get_reaction_metrics(post_id=post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:330:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post_id = 1
def get_reaction_metrics(post_id):
post_1=Post.objects.filter(id=post_id)
if post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:108: InvalidPostException
__________ test_get_reaction_metrics_for_given_post_id_more_than_one ___________
post = <Post: Post object (1)>, reaction2 = <Reaction: Reaction object (1)>
reaction3 = <Reaction: Reaction object (2)>
@pytest.mark.django_db
def test_get_reaction_metrics_for_given_post_id_more_than_one(post,reaction2,reaction3):
#Arrange
#Act
> a=get_reaction_metrics(post_id=post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post_id = 1
def get_reaction_metrics(post_id):
post_1=Post.objects.filter(id=post_id)
if post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:108: InvalidPostException
_____ test_get_reaction_metrics_for_given_post_id_raises_invalid_exception _____
reaction2 = <Reaction: Reaction object (1)>
@pytest.mark.django_db
def test_get_reaction_metrics_for_given_post_id_raises_invalid_exception(reaction2):
#Arrange
#Act
with pytest.raises(InvalidPostException):
> get_reaction_metrics(6)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidPostException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:347: Failed
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.287299) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.300475) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.361112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.363133) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.377405) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.938326) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.397395) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.398265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.399842) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.404479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.405591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.407098) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.421717) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.440138) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.458298) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.938423) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.478536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.479022) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.499666) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.500168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.938457) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.530555) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.531055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.550135) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.550630) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.569689) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.570355) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.938528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.590151) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.590598) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.591082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.611505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.612003) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.612530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.938567) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.633303) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.633808) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.634346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.634851) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.639645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.640105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.728340) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.728895) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.729386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.753571) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.754112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.772845) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.782975) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.788269) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.788686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.795629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.796063) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.806027) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.806461) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.815709) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.816160) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.938676) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.938884) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.938884) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.939028) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.939028) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.939028) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.939166) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.939166) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.939166) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.939304) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.939304) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_reaction_metrics_for_given_post_id - fb_pos...
FAILED fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
FAILED fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
================== 3 failed, 44 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 15
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -113,7 +113,7 @@
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
- if not post_1:
+ if post_1:
raise InvalidPostException
if post_1[0].posted_by_id==user_id:
post_1[0].delete()============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................FFF.............. [100%]
=================================== FAILURES ===================================
__________ test_delete_post_for_user_id_raises_invalid_user_exception __________
post = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_user_id_raises_invalid_user_exception(post):
#Arrange
#Act
with pytest.raises(InvalidUserException):
> delete_post(7,post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:356:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 7, post_id = 1
def delete_post(user_id, post_id):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
if post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:117: InvalidPostException
__________ test_delete_post_for_post_id_raises_invalid_post_exception __________
user = <User: User object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_raises_invalid_post_exception(user):
#Arrange
#Act
with pytest.raises(InvalidPostException):
> delete_post(user.id,5)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:365:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:118: in delete_post
if post_1[0].posted_by_id==user_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1
def delete_post(user_id, post_id):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
if post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:117: InvalidPostException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.958917) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.971586) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.027088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.028949) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.041711) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.612362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.060775) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.061599) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.063196) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.067761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.068877) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.070455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.085215) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.103516) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.123172) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.612477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.144538) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.145031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.166293) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.166800) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.612526) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.196892) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.197381) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.215919) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.216386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.235136) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.235748) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.612612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.256102) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.256573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.257086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.277780) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.278315) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.278839) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.612660) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.299965) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.300408) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.300873) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.301320) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.305802) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.306276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.312492) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.312983) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.313459) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.319873) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.320368) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.325322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.478955) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.503551) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.504033) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.511297) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.511741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.522076) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.522539) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.532017) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.532471) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.612791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.613012) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.613012) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.613173) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.613173) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.613173) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.613332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.613332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.613332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.613489) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.613489) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_delete_post_for_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 3 failed, 44 passed, 67 warnings in 1.18s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 16
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -118,7 +118,7 @@
if post_1[0].posted_by_id==user_id:
post_1[0].delete()
- if not user_1:
+ if user_1:
raise InvalidUserException
if post_1[0].posted_by_id!=user_id:
raise UserCannotDeletePostException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................F.F.............. [100%]
=================================== FAILURES ===================================
__________ test_delete_post_for_user_id_raises_invalid_user_exception __________
post = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_user_id_raises_invalid_user_exception(post):
#Arrange
#Act
with pytest.raises(InvalidUserException):
> delete_post(7,post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:356:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 7, post_id = 1
def delete_post(user_id, post_id):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
if not post_1:
raise InvalidPostException
if post_1[0].posted_by_id==user_id:
post_1[0].delete()
if user_1:
raise InvalidUserException
if post_1[0].posted_by_id!=user_id:
> raise UserCannotDeletePostException
E fb_post.exceptions.UserCannotDeletePostException
fb_post/utils.py:124: UserCannotDeletePostException
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1
def delete_post(user_id, post_id):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
if not post_1:
raise InvalidPostException
if post_1[0].posted_by_id==user_id:
post_1[0].delete()
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:122: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.952562) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.966316) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.026889) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.028824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.042821) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.604021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.062258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.063093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.064723) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.070306) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.071456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.073037) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.087010) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.105992) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.125265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.604120) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.146393) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.146885) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.168328) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.168866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.604161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.200445) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.200970) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.220852) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.221360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.241137) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.241767) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.604236) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.262409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.262862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.263360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.283248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.283712) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.284227) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.604276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.304751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.305243) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.305751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.306264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.311080) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.311547) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.317204) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.317650) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.318108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.323835) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.324272) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.328605) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.421777) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.446976) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.447457) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.454645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.455072) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.464600) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.465026) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.473565) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.474021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.604394) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.604599) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.604599) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.604745) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.604745) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.604745) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.604890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.604890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.604890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.605035) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.605035) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 2 failed, 45 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 17
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -136,7 +136,7 @@
#task 11
def get_posts_reacted_by_user(user_id):
user_1=User.objects.filter(id=user_id)
- if not user_1:
+ if user_1:
raise InvalidUserException
reaction_1=Reaction.objects.filter(reacted_by=user_id)
post_list=[]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...................................FF.......... [100%]
=================================== FAILURES ===================================
_________ test_get_posts_reacted_by_user_raises_invalid_user_exception _________
@pytest.mark.django_db
def test_get_posts_reacted_by_user_raises_invalid_user_exception():
#Arrange
#Act
with pytest.raises(InvalidUserException):
> get_posts_reacted_by_user(user_id=1)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidUserException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:417: Failed
_________ test_get_posts_reacted_by_user_for_valid_details_of_user_id __________
user = <User: User object (1)>, reaction2 = <Reaction: Reaction object (1)>
@pytest.mark.django_db
def test_get_posts_reacted_by_user_for_valid_details_of_user_id(user,reaction2):
#Arrange
#Act
> a=get_posts_reacted_by_user(user_id=user.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:425:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1
def get_posts_reacted_by_user(user_id):
user_1=User.objects.filter(id=user_id)
if user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:140: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.195641) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.209126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.269933) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.271890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.285697) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.844560) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.305692) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.306542) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.308191) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.313787) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.314885) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.316370) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.330128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.349760) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.369458) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.844672) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.390886) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.391403) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.412557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.413063) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.844718) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.443386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.443908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.463129) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.463627) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.482610) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.483265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.844805) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.504205) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.504715) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.505249) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.526035) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.526540) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.527062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.844850) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.548010) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.548477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.548989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.549482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.554186) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.554659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.560686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.561151) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.561620) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.567663) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.568108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.572754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.582356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.587569) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.588002) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.594745) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.595177) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.684199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.684700) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.712891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.713356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.844977) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.845200) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.845200) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.845369) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.845369) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.845369) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.845540) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.845540) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.845540) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.845707) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.845707) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_posts_reacted_by_user_raises_invalid_user_exception
FAILED fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
================== 2 failed, 45 passed, 67 warnings in 1.11s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 18
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -148,7 +148,7 @@
#task 12
def get_reactions_to_post(post_id):
post_1=Post.objects.filter(id=post_id)
- if not post_1:
+ if post_1:
raise InvalidPostException
reactions_of_post=Reaction.objects.filter(post_id=post_id)
post_list=[]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .....................................FF........ [100%]
=================================== FAILURES ===================================
___________ test_get_reactions_to_post_raises_invalid_post_exception ___________
@pytest.mark.django_db
def test_get_reactions_to_post_raises_invalid_post_exception():
#Arrange
#Act
with pytest.raises(InvalidPostException):
> get_reactions_to_post(post_id=3)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidPostException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:434: Failed
______________ test_get_reactions_to_post_for_valid_post_details _______________
post = <Post: Post object (1)>, reaction2 = <Reaction: Reaction object (1)>
@pytest.mark.django_db
def test_get_reactions_to_post_for_valid_post_details(post,reaction2):
#Arrange
#Act
> a=get_reactions_to_post(post_id=post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:441:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post_id = 1
def get_reactions_to_post(post_id):
post_1=Post.objects.filter(id=post_id)
if post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:152: InvalidPostException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.881104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.893759) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.949549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.951541) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.965741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.529041) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.984091) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.984938) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.986499) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.991144) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.992308) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.993868) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.008845) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.027860) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.047284) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.529151) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.069084) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.069605) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.091294) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.091834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.529199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.122543) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.123043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.141852) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.142373) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.160991) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.161636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.529282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.182317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.182809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.183337) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.203748) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.204270) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.204799) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.529326) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.226207) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.226711) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.227238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.227748) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.232665) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.233156) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.239367) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.239791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.240219) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.245815) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.246269) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.250940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.260920) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.266158) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.266592) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.273393) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.273844) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.283812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.284263) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.372897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.373409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.529447) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.529668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.529668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.529831) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.529831) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.529831) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.530025) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.530025) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.530025) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.530190) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.530190) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_reactions_to_post_raises_invalid_post_exception
FAILED fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details - ...
================== 2 failed, 45 passed, 67 warnings in 1.12s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 19
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -184,7 +184,7 @@
}
}
reply_list.append(replies)
- if not comment.parent_comment_id:
+ if comment.parent_comment_id:
comment = {
"comment_id": comment.id,
"commenter": {============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 5 identical items, use -vv to show
E Differing items:
E {'comments_count': 0} != {'comments_count': 1}
E {'comments': []} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:50.592822', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'thanks for ur wishes', 'comment_id': 2, 'commented_at': '2020-04-20 10:38:50.592989', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:50.592989', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:50.593161', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:50.593161', 'comment_content': 'thanks for ur wishes', 'reactions': {'count': 0, 'type': []}, 'replies_count': 0, 'replies': []}], 'comments_count': 1} != {'post_id': 1, 'posted_by': {'name': 'sr...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.943916) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.957536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.017622) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.019594) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.032601) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.592171) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.052120) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.052943) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.054520) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.060009) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.061145) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.062725) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.076453) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.095332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.114328) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.592284) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.135154) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.135649) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.156810) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.157337) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.592333) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.188767) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.189309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.208813) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.209309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.228127) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.228715) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.592418) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.249039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.249506) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.250031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.270283) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.270770) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.271285) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.592464) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.291987) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.292456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.292961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.293448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.298124) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.298583) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.304785) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.305259) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.305730) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.312053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.312528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.317426) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.327227) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.332528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.332962) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.339876) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.340269) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.349931) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.350362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.359543) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.359983) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.592589) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.592822) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.592822) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.592989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.592989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.592989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.593161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.593161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.593161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.593328) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.593328) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.15s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 20
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -241,7 +241,7 @@
posted_by_id = user_id
)
)
- if not post:
+ if post:
if not User.objects.filter(pk = user_id).exists():
raise InvalidUserException
res_list = []============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...........................................F... [100%]
=================================== FAILURES ===================================
________ test_get_user_posts_for_user_id_raises_invalid_user_exception _________
@pytest.mark.django_db
def test_get_user_posts_for_user_id_raises_invalid_user_exception():
#Arrange
#Act
with pytest.raises(InvalidUserException):
> get_user_posts(7)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidUserException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:559: Failed
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.948134) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.961971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.021942) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.023877) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.037556) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.600692) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.057164) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.058005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.059583) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.064696) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.065486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.066844) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.080643) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.099531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.118311) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.600790) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.138680) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.139175) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.159894) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.160399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.600831) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.190597) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.191049) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.209581) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.210103) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.228726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.229340) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.600905) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.249820) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.250322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.250834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.271189) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.271709) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.272243) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.600948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.293621) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.294156) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.294671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.295166) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.300049) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.300520) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.306697) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.307150) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.307592) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.313787) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.314269) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.319058) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.328991) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.334497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.334933) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.341893) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.342371) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.352420) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.352856) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.361862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.362302) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.601067) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.601280) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.601280) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.601433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.601433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.601433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.601590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.601590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.601590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.601750) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.601750) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_user_posts_for_user_id_raises_invalid_user_exception
================== 1 failed, 46 passed, 67 warnings in 1.10s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 21
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -242,7 +242,7 @@
)
)
if not post:
- if not User.objects.filter(pk = user_id).exists():
+ if User.objects.filter(pk = user_id).exists():
raise InvalidUserException
res_list = []
for p in post:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...........................................F... [100%]
=================================== FAILURES ===================================
________ test_get_user_posts_for_user_id_raises_invalid_user_exception _________
@pytest.mark.django_db
def test_get_user_posts_for_user_id_raises_invalid_user_exception():
#Arrange
#Act
with pytest.raises(InvalidUserException):
> get_user_posts(7)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidUserException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:559: Failed
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.431665) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.445537) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.506138) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.508083) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.522396) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.074205) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.542515) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.543369) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.544982) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.550542) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.551669) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.553218) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.566574) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.583616) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.602519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.074319) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.622987) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.623466) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.643834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.644329) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.074363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.674325) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.674829) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.693535) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.694055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.712456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.713053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.074448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.732851) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.733309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.733816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.753205) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.753666) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.754198) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.074487) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.774226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.774707) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.775211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.775703) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.780390) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.780847) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.786853) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.787321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.787789) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.793733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.794228) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.798870) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.808394) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.813516) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.813967) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.820768) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.821185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.830938) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.831359) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.840246) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.840664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.074615) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.074840) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.074840) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.075002) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.075002) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.075002) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.075166) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.075166) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.075166) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.075335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.075335) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_user_posts_for_user_id_raises_invalid_user_exception
================== 1 failed, 46 passed, 67 warnings in 1.09s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceUnaryOperator_Delete_Not, occurrence: 22
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -253,7 +253,7 @@
#task 15
def get_replies_for_comment(comment_id):
about_comment=Comment.objects.select_related("commented_by").filter(parent_comment_id=comment_id)
- if not about_comment:
+ if about_comment:
raise InvalidCommentException
comment_dict={}
comment_list=[]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .............................................FF [100%]
=================================== FAILURES ===================================
___ test_get_replies_for_comment_comment_id_raises_invalid_comment_exception ___
@pytest.mark.django_db
def test_get_replies_for_comment_comment_id_raises_invalid_comment_exception():
#Arrange
#Act
with pytest.raises(InvalidCommentException):
> get_replies_for_comment(6)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidCommentException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:609: Failed
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
e=reply_to_comment(d.id,b, "Thanks for ur wishes")
#Assert
> assert get_replies_for_comment(b)== [{
"comment_id": 2,
"commenter": {
"user_id": 1,
"name": "srinu",
"profile_pic": "www.facebook.com"
},
"commented_at": str(datetime.now()),
"comment_content": "Thanks for ur wishes",
}]
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:621:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
comment_id = 1
def get_replies_for_comment(comment_id):
about_comment=Comment.objects.select_related("commented_by").filter(parent_comment_id=comment_id)
if about_comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:257: InvalidCommentException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.511892) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.525854) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.586757) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.588713) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.602745) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.162962) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.622524) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.623361) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.624962) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.630577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.631708) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.633279) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.647400) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.665836) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.684721) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.163065) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.705382) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.705876) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.726548) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.727046) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.163106) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.757796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.758333) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.777392) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.777914) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.797157) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.797804) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.163187) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.818927) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.819433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.819955) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.841160) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.841695) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.842264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.163230) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.864340) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.864870) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.865412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.865954) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.870904) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.871384) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.877881) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.878401) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.878890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.885282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.885765) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.890714) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.900694) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.912662) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.913127) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.920356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.920805) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.931227) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.931689) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.941188) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.941642) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.163356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.163578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.163578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.163739) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.163739) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.163739) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.163913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.163913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.163913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.164068) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.164068) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_replies_for_comment_comment_id_raises_invalid_comment_exception
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 2 failed, 45 passed, 67 warnings in 1.14s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -7,7 +7,7 @@
from datetime import datetime
#task 2
def create_post(user_id, post_content):
- if not User.objects.filter(id=user_id).exists():
+ if not not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not post_content:
raise InvalidPostContent============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py FEFF.....................................FFF.F.F [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_create_post_user_id_raises_invalid_user_exception __
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7f5b5be51828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_post' with primary key '1' has an invalid foreign key: fb_post_post.posted_by_id contains a value '1' that does not have a corresponding value in fb_post_user.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
____________ test_create_post_user_id_raises_invalid_user_exception ____________
@pytest.mark.django_db
def test_create_post_user_id_raises_invalid_user_exception():
#Arrange
id_one=1
#Act
with pytest.raises(InvalidUserException):
> create_post(id_one,"hiii how are you")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidUserException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:63: Failed
________ test_create_post_content_raises_invalid_post_content_exception ________
user = <User: User object (1)>
@pytest.mark.django_db
def test_create_post_content_raises_invalid_post_content_exception(user):
#Arrange
id_one=1
#Act
with pytest.raises(InvalidPostContent):
> create_post(id_one,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:72:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = ''
def create_post(user_id, post_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
_______________ test_create_post_valid_user_id_and_post_content ________________
user = <User: User object (1)>
@pytest.mark.django_db
def test_create_post_valid_user_id_and_post_content(user):
#Arrange
id_one=1
#Act
> post_1=create_post(id_one,"hello guys")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'hello guys'
def create_post(user_id, post_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
_______________ test_get_post_with_no_comments_return_empty_list _______________
user = <User: User object (1)>
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_comments_return_empty_list(user):
#Arrange
> create_post(1,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:456:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:483:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:566:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:616:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:11: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.621076) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.815095) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.874904) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.876741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.890704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.288559) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.909874) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.910719) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.912259) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.916752) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.917808) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.919295) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.932670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.950989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.969086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.288662) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.988653) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.989119) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.008986) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.009463) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.288701) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.039709) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.040238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.060123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.060649) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.080377) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.081060) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.288779) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.101790) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.102296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.102789) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.122097) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.122637) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.123171) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.288820) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.144448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.144937) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.145425) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.145891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.150524) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.150968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.157141) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.157639) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.158137) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.164109) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.164603) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.169757) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.179530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.184433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.184853) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.191350) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.191762) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.201645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.202139) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.211090) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.211526) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_create_post_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_create_post_content_raises_invalid_post_content_exception
FAILED fb_post/tests.py::test_create_post_valid_user_id_and_post_content - fb...
FAILED fb_post/tests.py::test_get_post_with_no_comments_return_empty_list - f...
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - fb...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
ERROR fb_post/tests.py::test_create_post_user_id_raises_invalid_user_exception
============== 8 failed, 39 passed, 56 warnings, 1 error in 1.28s ==============
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -9,7 +9,7 @@
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
- if not post_content:
+ if not not post_content:
raise InvalidPostContent
new_post=Post.objects.create(content=post_content,posted_by_id=user_id,posted_at=datetime.now())============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .FF.....................................FFF.F.F [100%]
=================================== FAILURES ===================================
________ test_create_post_content_raises_invalid_post_content_exception ________
user = <User: User object (1)>
@pytest.mark.django_db
def test_create_post_content_raises_invalid_post_content_exception(user):
#Arrange
id_one=1
#Act
with pytest.raises(InvalidPostContent):
> create_post(id_one,"")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidPostContent'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:72: Failed
_______________ test_create_post_valid_user_id_and_post_content ________________
user = <User: User object (1)>
@pytest.mark.django_db
def test_create_post_valid_user_id_and_post_content(user):
#Arrange
id_one=1
#Act
> post_1=create_post(id_one,"hello guys")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'hello guys'
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not not post_content:
> raise InvalidPostContent
E fb_post.exceptions.InvalidPostContent
fb_post/utils.py:13: InvalidPostContent
_______________ test_get_post_with_no_comments_return_empty_list _______________
user = <User: User object (1)>
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_comments_return_empty_list(user):
#Arrange
> create_post(1,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:456:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not not post_content:
> raise InvalidPostContent
E fb_post.exceptions.InvalidPostContent
fb_post/utils.py:13: InvalidPostContent
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:483:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not not post_content:
> raise InvalidPostContent
E fb_post.exceptions.InvalidPostContent
fb_post/utils.py:13: InvalidPostContent
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not not post_content:
> raise InvalidPostContent
E fb_post.exceptions.InvalidPostContent
fb_post/utils.py:13: InvalidPostContent
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:566:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not not post_content:
> raise InvalidPostContent
E fb_post.exceptions.InvalidPostContent
fb_post/utils.py:13: InvalidPostContent
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
> c=create_post(d.id,"happy birthday")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:616:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_content = 'happy birthday'
def create_post(user_id, post_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not not post_content:
> raise InvalidPostContent
E fb_post.exceptions.InvalidPostContent
fb_post/utils.py:13: InvalidPostContent
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_content_raises_invalid_post_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.416264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.526727) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.585568) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.587531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.600930) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.065459) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.621100) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.621945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.623481) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.627886) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.628951) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.630510) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.643775) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.662142) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.680521) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.065556) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.700445) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.700991) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.721080) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.721589) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.065591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.751688) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.752211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.772071) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.772599) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.791980) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.792687) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.065667) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.814737) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.815265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.815800) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.837113) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.837658) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.838223) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.065701) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.860157) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.860629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.861126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.861636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.866425) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.866926) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.873567) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.874108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.874598) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.881013) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.881510) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.886683) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.896995) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.903505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.903971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.911189) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.911654) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.922226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.922698) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.932266) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.932726) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_create_post_content_raises_invalid_post_content_exception
FAILED fb_post/tests.py::test_create_post_valid_user_id_and_post_content - fb...
FAILED fb_post/tests.py::test_get_post_with_no_comments_return_empty_list - f...
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - fb...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 7 failed, 40 passed, 56 warnings in 1.18s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -16,7 +16,7 @@
return new_post.id
#task 3
def create_comment(user_id, post_id, comment_content):
- if not User.objects.filter(id=user_id).exists():
+ if not not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...FFFF..................................FF.F.F [100%]
=================================== FAILURES ===================================
__________ test_create_comment_user_id_raises_invalid_user_exception ___________
@pytest.mark.django_db
def test_create_comment_user_id_raises_invalid_user_exception():
#Arrange
id_one=1
id_two=2
#Act
with pytest.raises(InvalidUserException):
> create_comment(id_one,id_two,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:94:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 2, comment_content = 'hiii how are you'
def create_comment(user_id, post_id, comment_content):
if not not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
__________ test_create_comment_post_id_raises_invalid_post_exception ___________
user = <User: User object (1)>
@pytest.mark.django_db
def test_create_comment_post_id_raises_invalid_post_exception(user):
#Arrange
id_one=1
id_two=2
#Act
with pytest.raises(InvalidPostException):
> create_comment(id_one,id_two,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:104:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 2, comment_content = 'hiii how are you'
def create_comment(user_id, post_id, comment_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
_____ test_create_comment_content_raises_invalid_comment_content_exception _____
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_create_comment_content_raises_invalid_comment_content_exception(user,post):
#Arrange
id_one=1
#Act
with pytest.raises(InvalidCommentContent):
> create_comment(id_one,id_one,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = ''
def create_comment(user_id, post_id, comment_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
_________ test_create_comment_valid_user_post_ids_and_comment_content __________
user2 = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_create_comment_valid_user_post_ids_and_comment_content(user2,post):
#Arrange
id_one=1
#Act
> comment_1=create_comment(user2.id,post.id,"Thank you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:121:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'Thank you'
def create_comment(user_id, post_id, comment_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:484:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:518:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:567:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:617:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not not User.objects.filter(id=user_id).exists():
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:20: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.362179) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.479386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.561390) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.594984) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.012739) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.614614) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.615514) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.617121) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.621706) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.622848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.624411) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.638658) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.657627) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.676248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.012838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.697003) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.697487) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.718168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.718675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.012875) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.749589) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.750117) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.769568) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.770072) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.788742) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.789218) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.012945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.809716) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.810349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.810870) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.831052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.831533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.832046) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.012981) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.852483) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.852968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.853473) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.853992) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.858882) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.859350) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.865222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.865704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.866190) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.872070) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.872558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.877222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.886883) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.891915) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.892329) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.899731) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.900159) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.909726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.910160) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.919244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.919679) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.013098) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.013317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.013470) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.013617) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.013776) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_create_comment_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_create_comment_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
FAILED fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - fb...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 8 failed, 39 passed, 60 warnings in 1.21s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -18,7 +18,7 @@
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
- if not Post.objects.filter(id=post_id).exists():
+ if not not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
if not comment_content:
raise InvalidCommentContent============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ....FEFF..................................FF.F.F [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_create_comment_post_id_raises_invalid_post_exception _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7f46c7fe5828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.post_id contains a value '2' that does not have a corresponding value in fb_post_post.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
__________ test_create_comment_post_id_raises_invalid_post_exception ___________
user = <User: User object (1)>
@pytest.mark.django_db
def test_create_comment_post_id_raises_invalid_post_exception(user):
#Arrange
id_one=1
id_two=2
#Act
with pytest.raises(InvalidPostException):
> create_comment(id_one,id_two,"hiii how are you")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidPostException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:104: Failed
_____ test_create_comment_content_raises_invalid_comment_content_exception _____
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_create_comment_content_raises_invalid_comment_content_exception(user,post):
#Arrange
id_one=1
#Act
with pytest.raises(InvalidCommentContent):
> create_comment(id_one,id_one,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = ''
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not not Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
_________ test_create_comment_valid_user_post_ids_and_comment_content __________
user2 = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_create_comment_valid_user_post_ids_and_comment_content(user2,post):
#Arrange
id_one=1
#Act
> comment_1=create_comment(user2.id,post.id,"Thank you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:121:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'Thank you'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not not Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:484:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not not Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:518:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not not Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:567:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not not Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:617:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not not Post.objects.filter(id=post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:22: InvalidPostException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.180667) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_post_id_raises_invalid_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.191672) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.332563) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.411675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.444520) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.828891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.463516) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.464312) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.465812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.470121) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.471191) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.472678) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.486502) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.505784) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.525037) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.829003) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.545639) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.546127) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.566448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.566971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.829050) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.596330) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.596825) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.615459) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.615951) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.634324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.634793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.829139) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.654557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.655142) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.655639) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.675416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.675882) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.676380) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.829181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.696450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.696908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.697400) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.697879) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.702594) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.703065) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.708927) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.709403) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.709868) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.715657) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.716106) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.720585) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.730066) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.735196) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.735602) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.742192) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.742597) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.752060) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.752490) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.762278) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.762688) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.829314) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.829534) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.829705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.829880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.830074) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_create_comment_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
FAILED fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - fb...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
ERROR fb_post/tests.py::test_create_comment_post_id_raises_invalid_post_exception
============== 7 failed, 40 passed, 61 warnings, 1 error in 1.24s ==============
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 4
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -20,7 +20,7 @@
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
- if not comment_content:
+ if not not comment_content:
raise InvalidCommentContent
new_comment=Comment.objects.create(content=comment_content,
commented_by_id=user_id,============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .....FF..................................FF.F.F [100%]
=================================== FAILURES ===================================
_____ test_create_comment_content_raises_invalid_comment_content_exception _____
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_create_comment_content_raises_invalid_comment_content_exception(user,post):
#Arrange
id_one=1
#Act
with pytest.raises(InvalidCommentContent):
> create_comment(id_one,id_one,"")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidCommentContent'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:113: Failed
_________ test_create_comment_valid_user_post_ids_and_comment_content __________
user2 = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_create_comment_valid_user_post_ids_and_comment_content(user2,post):
#Arrange
id_one=1
#Act
> comment_1=create_comment(user2.id,post.id,"Thank you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:121:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'Thank you'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
if not not comment_content:
> raise InvalidCommentContent
E fb_post.exceptions.InvalidCommentContent
fb_post/utils.py:24: InvalidCommentContent
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:484:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
if not not comment_content:
> raise InvalidCommentContent
E fb_post.exceptions.InvalidCommentContent
fb_post/utils.py:24: InvalidCommentContent
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:518:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
if not not comment_content:
> raise InvalidCommentContent
E fb_post.exceptions.InvalidCommentContent
fb_post/utils.py:24: InvalidCommentContent
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:567:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
if not not comment_content:
> raise InvalidCommentContent
E fb_post.exceptions.InvalidCommentContent
fb_post/utils.py:24: InvalidCommentContent
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
> b=create_comment(d.id,c,"happy day")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:617:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, comment_content = 'happy day'
def create_comment(user_id, post_id, comment_content):
if not User.objects.filter(id=user_id).exists():
raise InvalidUserException
if not Post.objects.filter(id=post_id).exists():
raise InvalidPostException
if not not comment_content:
> raise InvalidCommentContent
E fb_post.exceptions.InvalidCommentContent
fb_post/utils.py:24: InvalidCommentContent
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.531933) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.545563) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.174231) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.671661) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.705468) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.174299) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.724633) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.725486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.727137) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.731763) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.732921) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.734558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.748755) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.767596) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.786094) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.174414) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.806755) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.807245) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.827983) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.828502) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.174461) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.858718) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.859218) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.878514) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.879044) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.898363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.898883) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.174541) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.919589) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.920165) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.920645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.941124) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.941638) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.942185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.174586) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.963233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.963727) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.964259) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.964756) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.969724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.970226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.976361) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.976875) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.977361) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.983350) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.983849) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.988667) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.999211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.004547) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.004990) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.011895) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.012322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.022032) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.022474) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.031871) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.032308) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.174715) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.174937) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.175102) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.175256) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.175406) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
FAILED fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - fb...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 6 failed, 41 passed, 61 warnings in 1.17s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 5
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -33,7 +33,7 @@
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
- if not user:
+ if not not user:
raise InvalidUserException
if not comment:
raise InvalidCommentException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .......FFFFFE..............................F.F.F [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7f7d18dd2828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.parent_comment_id contains a value '2' that does not have a corresponding value in fb_post_comment.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
_________ test_reply_to_comment_user_id_raises_invalid_user_exception __________
@pytest.mark.django_db
def test_reply_to_comment_user_id_raises_invalid_user_exception():
#Arrange
id_two=2
#Act
with pytest.raises(InvalidUserException):
> reply_to_comment(id_two,id_two,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:133:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 2, comment_id = 2, reply_content = 'hiii how are you'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not not user:
raise InvalidUserException
if not comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
______ test_reply_to_comment_comment_id_raises_invalid_comment_exception _______
user = <User: User object (1)>
@pytest.mark.django_db
def test_reply_to_comment_comment_id_raises_invalid_comment_exception(user):
#Arrange
id_one=1
id_two=2
#Act
with pytest.raises(InvalidCommentException):
> reply_to_comment(id_one,id_two,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:143:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 2, reply_content = 'hiii how are you'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not not user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
_ test_reply_to_comment_comment_content_raises_invalid_reply_content_exception _
user2 = <User: User object (1)>, post = <Post: Post object (1)>
user = <User: User object (2)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_reply_to_comment_comment_content_raises_invalid_reply_content_exception(user2,post,user):
#Arrange
Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user2.id,post_id=post.id)
#Act
with pytest.raises(InvalidReplyContent):
> reply_to_comment(1,1,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:153:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = ''
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not not user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id(user,post):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'welcome'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not not user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
user2 = <User: User object (2)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id(user,post,user2):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id,parent_comment_id=user2.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'welcome'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not not user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:519:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not not user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:568:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not not user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> e=reply_to_comment(d.id,b, "Thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:619:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'Thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not not user:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:37: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.695258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.708066) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.766440) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.768268) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.886546) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.349189) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.925143) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.926041) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.950474) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.951620) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.045427) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.063809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.081868) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.349296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.102322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.102818) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.123686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.124191) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.349337) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.151505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.152008) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.170640) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.171126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.188519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.189174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.349418) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.209640) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.210138) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.210636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.229987) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.230519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.231058) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:48.349464) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.250960) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:49.251409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.251881) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.252318) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.256586) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.257033) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.263071) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.263525) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.263990) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.269888) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.270362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.274904) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.284407) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.289402) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.289807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.296457) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.296859) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.307007) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.307418) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:49.316194) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:49.316613) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.349585) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.349816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.349816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.350006) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.350006) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.350180) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.350180) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:48.350348) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:48.350348) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_reply_to_comment_comment_id_raises_invalid_comment_exception
FAILED fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
ERROR fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
============== 8 failed, 39 passed, 63 warnings, 1 error in 1.32s ==============
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 6
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -35,7 +35,7 @@
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
- if not comment:
+ if not not comment:
raise InvalidCommentException
if not reply_content:
raise InvalidReplyContent============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........FFFFE..............................F.F.F [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7f2a7e3a5828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.parent_comment_id contains a value '2' that does not have a corresponding value in fb_post_comment.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
______ test_reply_to_comment_comment_id_raises_invalid_comment_exception _______
user = <User: User object (1)>
@pytest.mark.django_db
def test_reply_to_comment_comment_id_raises_invalid_comment_exception(user):
#Arrange
id_one=1
id_two=2
#Act
with pytest.raises(InvalidCommentException):
> reply_to_comment(id_one,id_two,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:143:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:42: in reply_to_comment
if comment[0].parent_comment_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
_ test_reply_to_comment_comment_content_raises_invalid_reply_content_exception _
user2 = <User: User object (1)>, post = <Post: Post object (1)>
user = <User: User object (2)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_reply_to_comment_comment_content_raises_invalid_reply_content_exception(user2,post,user):
#Arrange
Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user2.id,post_id=post.id)
#Act
with pytest.raises(InvalidReplyContent):
> reply_to_comment(1,1,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:153:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = ''
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not not comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id(user,post):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'welcome'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not not comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
user2 = <User: User object (2)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id(user,post,user2):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id,parent_comment_id=user2.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'welcome'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not not comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:519:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not not comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:568:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not not comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> e=reply_to_comment(d.id,b, "Thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:619:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'Thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not not comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:39: InvalidCommentException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.453100) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.466904) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.526443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.528377) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.667956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.094983) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.706647) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.707554) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.732169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.733446) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.828907) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.848443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.867362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.095101) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.888286) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.888784) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.909857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.910406) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.095145) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.941458) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.941996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.961590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.962126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.980865) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.981513) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.095232) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.001179) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.001699) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.002276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.023311) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.023838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.024378) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.095277) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.045729) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.046233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.046753) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.047264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.052071) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.052548) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.059068) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.059572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.060047) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.066067) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.066548) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.071346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.081239) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.086401) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.086839) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.093556) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.094041) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.103915) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.104353) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.113398) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.113870) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.095411) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.095651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.095651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.095814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.095814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.095977) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.095977) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.096141) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.096141) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_comment_id_raises_invalid_comment_exception
FAILED fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
ERROR fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
============== 7 failed, 40 passed, 63 warnings, 1 error in 1.37s ==============
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 7
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -37,7 +37,7 @@
raise InvalidUserException
if not comment:
raise InvalidCommentException
- if not reply_content:
+ if not not reply_content:
raise InvalidReplyContent
if comment[0].parent_comment_id:
reply_comment=Comment.objects.create(content=reply_content,============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........FFFE..............................F.F.F [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7fe43b3cc7b8>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.parent_comment_id contains a value '2' that does not have a corresponding value in fb_post_comment.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
_ test_reply_to_comment_comment_content_raises_invalid_reply_content_exception _
user2 = <User: User object (1)>, post = <Post: Post object (1)>
user = <User: User object (2)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_reply_to_comment_comment_content_raises_invalid_reply_content_exception(user2,post,user):
#Arrange
Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user2.id,post_id=post.id)
#Act
with pytest.raises(InvalidReplyContent):
> reply_to_comment(1,1,"")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidReplyContent'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:153: Failed
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id(user,post):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'welcome'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not comment:
raise InvalidCommentException
if not not reply_content:
> raise InvalidReplyContent
E fb_post.exceptions.InvalidReplyContent
fb_post/utils.py:41: InvalidReplyContent
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
user2 = <User: User object (2)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id(user,post,user2):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id,parent_comment_id=user2.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'welcome'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not comment:
raise InvalidCommentException
if not not reply_content:
> raise InvalidReplyContent
E fb_post.exceptions.InvalidReplyContent
fb_post/utils.py:41: InvalidReplyContent
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:519:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not comment:
raise InvalidCommentException
if not not reply_content:
> raise InvalidReplyContent
E fb_post.exceptions.InvalidReplyContent
fb_post/utils.py:41: InvalidReplyContent
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:568:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not comment:
raise InvalidCommentException
if not not reply_content:
> raise InvalidReplyContent
E fb_post.exceptions.InvalidReplyContent
fb_post/utils.py:41: InvalidReplyContent
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> e=reply_to_comment(d.id,b, "Thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:619:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reply_content = 'Thanks for ur wishes'
def reply_to_comment(user_id, comment_id, reply_content):
comment=Comment.objects.filter(id=comment_id)
user=User.objects.filter(id=user_id)
if not user:
raise InvalidUserException
if not comment:
raise InvalidCommentException
if not not reply_content:
> raise InvalidReplyContent
E fb_post.exceptions.InvalidReplyContent
fb_post/utils.py:41: InvalidReplyContent
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.981190) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.994345) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.048989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.050997) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.064583) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.630442) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.160455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.161335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.186439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.187643) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.283217) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.301827) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.320705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.630555) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.341233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.341735) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.362898) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.363415) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.630600) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.393006) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.393518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.412881) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.413401) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.432595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.433239) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.630681) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.453510) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.453994) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.454496) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.474173) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.474642) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.475162) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.630727) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.495669) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.496156) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.496669) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.497163) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.501941) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.502432) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.508621) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.509098) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.509566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.515789) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.516259) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.521040) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.531507) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.536865) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.537304) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.544389) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.544843) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.554883) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.555320) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.564482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.564901) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.630857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.631080) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.631080) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.631244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.631244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.631410) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.631410) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.631580) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.631580) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
ERROR fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
============== 6 failed, 41 passed, 63 warnings, 1 error in 1.24s ==============
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 8
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -39,7 +39,7 @@
raise InvalidCommentException
if not reply_content:
raise InvalidReplyContent
- if comment[0].parent_comment_id:
+ if not comment[0].parent_comment_id:
reply_comment=Comment.objects.create(content=reply_content,
commented_by_id=user_id,
commented_at=datetime.now(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..........................................F.F.F [100%]
=================================== FAILURES ===================================
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 5 identical items, use -vv to show
E Differing items:
E {'comments_count': 2} != {'comments_count': 1}
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:58.786482', 'comment...: '2020-04-20 10:38:58.786482', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:58.786482', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:58.786643', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:58.786643', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 0, 'replies': []}, {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
e=reply_to_comment(d.id,b, "Thanks for ur wishes")
#Assert
> assert get_replies_for_comment(b)== [{
"comment_id": 2,
"commenter": {
"user_id": 1,
"name": "srinu",
"profile_pic": "www.facebook.com"
},
"commented_at": str(datetime.now()),
"comment_content": "Thanks for ur wishes",
}]
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:621:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
comment_id = 1
def get_replies_for_comment(comment_id):
about_comment=Comment.objects.select_related("commented_by").filter(parent_comment_id=comment_id)
if not about_comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:257: InvalidCommentException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.133047) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.146764) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.207644) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.209748) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.224328) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.785700) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.239810) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.240671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.242327) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.248018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.249194) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.250868) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.265139) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.283837) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.302681) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.785801) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.323432) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.323943) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.344897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.345414) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.785843) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.374953) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.375456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.394397) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.394901) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.413794) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.414442) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.785936) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.434651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.435136) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.435655) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.455751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.456260) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.456785) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.785978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.477433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.477893) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.478426) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.478922) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.483523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.484000) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.489932) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.490404) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.490869) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.496976) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.497439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.502219) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.511960) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.517080) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.517483) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.524435) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.524856) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.534607) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.535064) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.544246) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.544694) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.786103) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.786321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.786321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.786482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.786482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.786482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.786643) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.786643) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.786643) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.786805) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.786805) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 3 failed, 44 passed, 67 warnings in 1.14s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 9
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -58,7 +58,7 @@
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
- if not user_1:
+ if not not user_1:
raise InvalidUserException
if not post_1:
raise InvalidPostException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............FFFFFFF.......................F.F.. [100%]
=================================== FAILURES ===================================
___________ test_react_to_post_user_id_raises_invalid_user_exception ___________
@pytest.mark.django_db
def test_react_to_post_user_id_raises_invalid_user_exception():
#Arrange
#Act
with pytest.raises(InvalidUserException):
> react_to_post(1,2,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:184:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 2, reaction_type = 'hiii how are you'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not not user_1:
raise InvalidUserException
if not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
___________ test_react_to_post_post_id_raises_invalid_post_exception ___________
user = <User: User object (1)>
@pytest.mark.django_db
def test_react_to_post_post_id_raises_invalid_post_exception(user):
#Arrange
#Act
with pytest.raises(InvalidPostException):
> react_to_post(1,2,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:192:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 2, reaction_type = 'hiii how are you'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
_ test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field _
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field(user,post):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_post(1,1,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:200:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = ''
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
_ test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field _
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field(user,post):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_post(1,1,"HELLO")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'HELLO'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
__________ test_react_to_post_valid_reaction_type_for_the_first_time ___________
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_first_time(user,post):
#Arrange
#Act
> react_to_post(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:216:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"LIT")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LIT'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:237:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'WOW'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:520:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:569:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:62: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.302486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.316165) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.375533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.377479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.391228) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.947840) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.410678) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.411491) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.413036) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.417464) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.418561) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.420092) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.537309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.574615) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.611248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.649374) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.649868) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.687512) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.687974) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.735686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.736166) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.755914) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.756374) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.775768) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.776226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.948088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.797452) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.798047) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.798572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.820118) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.820589) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.821127) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.948134) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.842426) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.842843) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.843312) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.843734) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.848293) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.848679) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.854337) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.854726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.855141) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.860570) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.860989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.866390) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.876179) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.881288) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.881710) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.888702) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.889125) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.898963) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.899386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.908602) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.909031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.948268) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.948496) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.948496) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.948668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.948668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.948837) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.948837) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.949002) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.949002) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_react_to_post_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
FAILED fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 9 failed, 38 passed, 63 warnings in 1.25s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 10
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -60,7 +60,7 @@
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
- if not post_1:
+ if not not post_1:
raise InvalidPostException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .............FFFFFF.......................F.F.. [100%]
=================================== FAILURES ===================================
___________ test_react_to_post_post_id_raises_invalid_post_exception ___________
user = <User: User object (1)>
@pytest.mark.django_db
def test_react_to_post_post_id_raises_invalid_post_exception(user):
#Arrange
#Act
with pytest.raises(InvalidPostException):
> react_to_post(1,2,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:192:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 2, reaction_type = 'hiii how are you'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not not post_1:
raise InvalidPostException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:66: InvalidReactionTypeException
_ test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field _
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field(user,post):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_post(1,1,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:200:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = ''
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
_ test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field _
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field(user,post):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_post(1,1,"HELLO")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'HELLO'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
__________ test_react_to_post_valid_reaction_type_for_the_first_time ___________
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_first_time(user,post):
#Arrange
#Act
> react_to_post(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:216:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"LIT")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LIT'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:237:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'WOW'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:520:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:569:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:64: InvalidPostException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.281455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.295830) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.353864) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.355762) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.370100) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.924828) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.389657) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.390513) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.392073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.397766) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.398932) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.400508) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.499718) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.537315) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.575194) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.613037) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.613566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.651939) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.652477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.700596) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.701123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.719968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.720443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.738485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.738948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.925057) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.758982) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.759590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.760104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.780433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.780916) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.781441) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.925103) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.802210) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.802708) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.803219) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.803714) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.808786) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.809263) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.815654) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.816138) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.816618) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.822855) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.823341) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.828507) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.838838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.844342) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.844800) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.852100) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.852524) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.862618) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.863053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.872360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.872803) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.925227) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.925436) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.925436) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.925595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.925595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.925754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.925754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.925938) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.925938) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
FAILED fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 8 failed, 39 passed, 63 warnings in 1.24s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 11
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -62,7 +62,7 @@
raise InvalidUserException
if not post_1:
raise InvalidPostException
- if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
+ if not reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............FFFFF.......................F.F.. [100%]
=================================== FAILURES ===================================
_ test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field _
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field(user,post):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_post(1,1,"")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidReactionTypeException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:200: Failed
_ test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field _
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field(user,post):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_post(1,1,"HELLO")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidReactionTypeException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:208: Failed
__________ test_react_to_post_valid_reaction_type_for_the_first_time ___________
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_first_time(user,post):
#Arrange
#Act
> react_to_post(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:216:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not post_1:
raise InvalidPostException
if not reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:66: InvalidReactionTypeException
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"LIT")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LIT'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not post_1:
raise InvalidPostException
if not reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:66: InvalidReactionTypeException
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:237:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'WOW'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not post_1:
raise InvalidPostException
if not reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:66: InvalidReactionTypeException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:520:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not post_1:
raise InvalidPostException
if not reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:66: InvalidReactionTypeException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:569:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1, reaction_type = 'LOVE'
def react_to_post(user_id, post_id, reaction_type):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, post_id =post_id)
if not user_1:
raise InvalidUserException
if not post_1:
raise InvalidPostException
if not reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:66: InvalidReactionTypeException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.705490) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.718661) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.777354) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.779273) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.792961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.359588) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.812384) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.813182) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.814747) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.819232) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.820308) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.821784) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.836862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.359639) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.933940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.359666) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.966484) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.004479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.005005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.042381) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.042873) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.089895) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.090394) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.109487) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.109984) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.128346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.128824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.359815) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.149096) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.149696) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.150221) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.171311) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.171826) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.172352) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.359857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.193550) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.194071) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.194572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.195054) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.200018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.200471) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.206592) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.207056) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.207503) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.213443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.213924) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.218889) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.228999) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.234233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.234670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.243528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.243989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.258042) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.258497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.267296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.267720) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.359980) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.360211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.360211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.360383) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.360383) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.360553) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.360553) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.360719) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.360719) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
FAILED fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 7 failed, 40 passed, 65 warnings in 1.19s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 12
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -64,7 +64,7 @@
raise InvalidPostException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException
- if not reaction_2:
+ if not not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
if reaction_2[0].reaction==reaction_type:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ................FFF.......................F.F.. [100%]
=================================== FAILURES ===================================
__________ test_react_to_post_valid_reaction_type_for_the_first_time ___________
user = <User: User object (1)>, post = <Post: Post object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_first_time(user,post):
#Arrange
#Act
> react_to_post(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:216:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:70: in react_to_post
if reaction_2[0].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_post(user.id,post.id,"LIT")
#Assert
reaction_1=Reaction.objects.all()
> assert list(reaction_1)==[]
E assert [<Reaction: R...n object (2)>] == []
E Left contains 2 more items, first extra item: <Reaction: Reaction object (1)>
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:229: AssertionError
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_post(user.id,post.id,"WOW")
#Assert
reaction_1=Reaction.objects.all()
> assert reaction_1[0].reaction=="WOW"
E AssertionError: assert 'LIT' == 'WOW'
E - WOW
E + LIT
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:240: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:520:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:70: in react_to_post
if reaction_2[0].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
> react_to_post(d.id, c, "LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:569:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:70: in react_to_post
if reaction_2[0].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.608154) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.616605) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.651736) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.652967) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.661332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.376924) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.672722) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.673252) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.674288) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.677000) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.677726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.678750) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.687741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.698499) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.709241) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.788996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.789357) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.377060) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.809136) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.809450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.377082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.834792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.835123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.847337) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.847664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.859529) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.859857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.377171) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.872804) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.873220) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.873569) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.886512) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.886845) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.887192) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.377219) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.899956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.900266) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.900602) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.900928) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.903929) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.904236) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.907988) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.908300) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.908601) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.912293) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.912601) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.915536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.921576) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.924775) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.925042) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.929222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.929503) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.935454) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.935724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.941400) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.941679) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.377349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.377570) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.377570) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.377740) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.377740) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.377930) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.377930) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.378107) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.378107) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 5 failed, 42 passed, 65 warnings in 0.81s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 13
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -67,7 +67,7 @@
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if not reaction_2[0].reaction==reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .................FF............................ [100%]
=================================== FAILURES ===================================
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_post(user.id,post.id,"LIT")
#Assert
reaction_1=Reaction.objects.all()
> assert list(reaction_1)==[]
E assert [<Reaction: R...n object (1)>] == []
E Left contains one more item: <Reaction: Reaction object (1)>
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:229: AssertionError
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_post(user.id,post.id,"WOW")
#Assert
reaction_1=Reaction.objects.all()
> assert reaction_1[0].reaction=="WOW"
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:240:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
return self._result_cache[k]
if isinstance(k, slice):
qs = self._chain()
if k.start is not None:
start = int(k.start)
else:
start = None
if k.stop is not None:
stop = int(k.stop)
else:
stop = None
qs.query.set_limits(start, stop)
return list(qs)[::k.step] if k.step else qs
qs = self._chain()
qs.query.set_limits(k, k + 1)
qs._fetch_all()
> return qs._result_cache[0]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:314: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.309363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.323572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.384229) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.386286) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.400495) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.962969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.420789) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.421661) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.423336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.429132) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.430325) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.431972) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.446543) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.466042) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.484948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.963073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.506005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.506511) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.963094) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.599116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.599641) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.690662) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.691178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.710456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.710949) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.729595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.730074) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.963195) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.750608) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.751241) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.751769) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.771364) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.771837) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.772329) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.963234) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.792776) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.793263) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.793786) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.794300) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.799255) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.799724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.805956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.806440) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.806918) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.812862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.813331) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.818108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.827965) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.833118) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.833556) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.840438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.840861) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.850528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.850963) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.860215) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.860659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.963358) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.963566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.963566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.963720) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.963720) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.963720) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.963887) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.963887) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.963887) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.964042) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.964042) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
================== 2 failed, 45 passed, 67 warnings in 1.16s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 14
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -81,7 +81,7 @@
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
- if not user_1:
+ if not not user_1:
raise InvalidUserException
if not comment_1:
raise InvalidCommentException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...................FFFFFFF................F.F.. [100%]
=================================== FAILURES ===================================
_________ test_react_to_comment_user_id_raises_invalid_user_exception __________
@pytest.mark.django_db
def test_react_to_comment_user_id_raises_invalid_user_exception():
#Arrange
#Act
with pytest.raises(InvalidUserException):
> react_to_comment(1,2,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:249:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 2, reaction_type = 'hiii how are you'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not not user_1:
raise InvalidUserException
if not comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
_________ test_react_to_comment_post_id_raises_invalid_post_exception __________
user = <User: User object (1)>
@pytest.mark.django_db
def test_react_to_comment_post_id_raises_invalid_post_exception(user):
#Arrange
#Act
with pytest.raises(InvalidCommentException):
> react_to_comment(1,2,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:258:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 2, reaction_type = 'hiii how are you'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
_ test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field(user,comment):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_comment(1,1,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:268:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = ''
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
_ test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field(user,comment):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_comment(1,1,"HELLO")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:278:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'HELLO'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
_________ test_react_to_comment_valid_reaction_type_for_the_first_time _________
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_first_time(user,comment):
#Arrange
#Act
> react_to_comment(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:289:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'LOVE'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:300:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'LOVE'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:311:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:521:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:570:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:85: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.161521) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.174590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.230707) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.232582) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.245478) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.816704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.264579) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.265390) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.266945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.271318) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.272417) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.273981) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.288428) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.306471) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.325683) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.816814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.346366) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.346844) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.367428) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.367926) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.816857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.500975) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.501462) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.539010) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.539543) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.576755) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.577287) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.614846) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.615397) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.615933) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.653199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.653728) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.654314) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.691406) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:14.691941) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.692472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.692990) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.697833) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.698325) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.704771) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.705261) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.705733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.711787) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.712263) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.716990) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.726827) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.731987) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.732417) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.739261) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.739690) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.749569) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.750020) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:14.758984) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:14.759406) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.817122) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.817345) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.817345) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.817509) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.817509) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.817509) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.817669) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.817669) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.817669) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.817828) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.817828) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_react_to_comment_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
FAILED fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 9 failed, 38 passed, 65 warnings in 1.25s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 15
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -83,7 +83,7 @@
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
- if not comment_1:
+ if not not comment_1:
raise InvalidCommentException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ....................FFFFFF................F.F.. [100%]
=================================== FAILURES ===================================
_________ test_react_to_comment_post_id_raises_invalid_post_exception __________
user = <User: User object (1)>
@pytest.mark.django_db
def test_react_to_comment_post_id_raises_invalid_post_exception(user):
#Arrange
#Act
with pytest.raises(InvalidCommentException):
> react_to_comment(1,2,"hiii how are you")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:258:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 2, reaction_type = 'hiii how are you'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not not comment_1:
raise InvalidCommentException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:89: InvalidReactionTypeException
_ test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field(user,comment):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_comment(1,1,"")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:268:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = ''
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not not comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
_ test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field(user,comment):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_comment(1,1,"HELLO")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:278:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'HELLO'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not not comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
_________ test_react_to_comment_valid_reaction_type_for_the_first_time _________
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_first_time(user,comment):
#Arrange
#Act
> react_to_comment(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:289:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'LOVE'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not not comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:300:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'LOVE'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not not comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:311:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not not comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:521:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not not comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:570:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not not comment_1:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:87: InvalidCommentException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.895087) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.909265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.970635) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.972564) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.986500) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.542834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.005810) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.006632) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.008072) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.012114) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.013150) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.014586) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.028103) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.046723) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.065508) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.542946) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.085708) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.086200) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.106793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.107281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.542992) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.220485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.221018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.258809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.259336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.297053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.297558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.334741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.335250) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.335761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.372978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.373502) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.374061) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.411197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.411693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.412200) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.412684) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.417501) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.417984) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.424189) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.424653) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.425103) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.430834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.431278) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.435996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.445503) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.450320) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.450715) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.457294) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.457710) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.467448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.467852) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.476465) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.476891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.543257) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.543476) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.543476) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.543639) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.543639) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.543639) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.543814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.543814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.543814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.543983) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.543983) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
FAILED fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 8 failed, 39 passed, 65 warnings in 1.23s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 16
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -85,7 +85,7 @@
raise InvalidUserException
if not comment_1:
raise InvalidCommentException
- if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
+ if not reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .....................FFFFF................F.F.. [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field(user,comment):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_comment(1,1,"")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidReactionTypeException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:268: Failed
_ test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field(user,comment):
#Arrange
#Act
with pytest.raises(InvalidReactionTypeException):
> react_to_comment(1,1,"HELLO")
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidReactionTypeException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:278: Failed
_________ test_react_to_comment_valid_reaction_type_for_the_first_time _________
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_first_time(user,comment):
#Arrange
#Act
> react_to_comment(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:289:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'LOVE'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not comment_1:
raise InvalidCommentException
if not reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:89: InvalidReactionTypeException
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:300:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'LOVE'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not comment_1:
raise InvalidCommentException
if not reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:89: InvalidReactionTypeException
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:311:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not comment_1:
raise InvalidCommentException
if not reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:89: InvalidReactionTypeException
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:521:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not comment_1:
raise InvalidCommentException
if not reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:89: InvalidReactionTypeException
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:570:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, comment_id = 1, reaction_type = 'WOW'
def react_to_comment(user_id, comment_id, reaction_type):
user_1=User.objects.filter(id=user_id)
comment_1=Comment.objects.filter(id=comment_id)
reaction_2=Reaction.objects.filter(reacted_by_id=user_id, comment_id =comment_id)
if not user_1:
raise InvalidUserException
if not comment_1:
raise InvalidCommentException
if not reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
> raise InvalidReactionTypeException
E fb_post.exceptions.InvalidReactionTypeException
fb_post/utils.py:89: InvalidReactionTypeException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.350742) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.359279) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.394351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.395584) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.404061) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.125433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.415497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.416038) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.417050) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.419808) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.420548) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.421565) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.430699) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.441718) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.453050) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.125499) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.465790) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.466139) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.479453) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.479796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.125525) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.498824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.499156) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.125543) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.554066) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.554422) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.125557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.574117) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.574426) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.596080) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.596395) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.596733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.618405) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.618718) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.619055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.640584) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.640899) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.641235) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.641562) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.644509) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.644811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.648691) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.649008) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.649308) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.653014) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.653321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.656299) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.662303) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.665598) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.665872) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.670108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.670381) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.676450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.676722) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.682389) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.682661) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.125668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.125813) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.125813) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.125925) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.125925) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.125925) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.126021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.126021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.126021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.126112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.126112) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
FAILED fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 7 failed, 40 passed, 67 warnings in 0.72s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 17
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -87,7 +87,7 @@
raise InvalidCommentException
if reaction_type not in["WOW","LOVE","LIT","THUMBS-UP","THUMBS-DOWN","SAD","ANGRY","HAHA"]:
raise InvalidReactionTypeException
- if not reaction_2:
+ if not not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
if reaction_2[0].reaction==reaction_type:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .......................FFF................F.F.. [100%]
=================================== FAILURES ===================================
_________ test_react_to_comment_valid_reaction_type_for_the_first_time _________
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_first_time(user,comment):
#Arrange
#Act
> react_to_comment(1,1,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:289:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:93: in react_to_comment
if reaction_2[0].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_comment(user.id,comment.id,"LOVE")
#Assert
reaction_1=Reaction.objects.all()
> assert list(reaction_1)==[]
E assert [<Reaction: R...n object (2)>] == []
E Left contains 2 more items, first extra item: <Reaction: Reaction object (1)>
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:303: AssertionError
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_comment(user.id,comment.id,"WOW")
#Assert
reaction_1=Reaction.objects.all()
> assert reaction_1[0].reaction=="WOW"
E AssertionError: assert 'LOVE' == 'WOW'
E - WOW
E + LOVE
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:314: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:521:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:93: in react_to_comment
if reaction_2[0].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
> react_to_comment(d.id, b, "WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:570:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:93: in react_to_comment
if reaction_2[0].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.061132) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.074761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.134489) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.136282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.148823) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.712190) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.167792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.168600) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.170097) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.175417) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.176559) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.178106) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.192114) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.210148) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.228739) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.712289) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.248508) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.248955) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.270685) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.271201) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.712330) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.301855) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.302386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.320665) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.321189) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.340832) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.341464) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.485720) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.486290) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.486832) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.712428) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.521097) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.521659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.522234) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.712447) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.556771) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:46.557292) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.557819) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.558343) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.564520) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.564966) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.571295) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.571780) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.572251) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.578107) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.578586) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.583300) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.593136) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.598190) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.598608) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.605269) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.605710) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.615759) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.616185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:46.625161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:46.625573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.712571) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.712793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.712793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.712957) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.712957) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.712957) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.713116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.713116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.713116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.713266) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.713266) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 5 failed, 42 passed, 67 warnings in 1.32s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 18
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -90,7 +90,7 @@
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if not reaction_2[0].reaction==reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................FF..................... [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_comment(user.id,comment.id,"LOVE")
#Assert
reaction_1=Reaction.objects.all()
> assert list(reaction_1)==[]
E assert [<Reaction: R...n object (1)>] == []
E Left contains one more item: <Reaction: Reaction object (1)>
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:303: AssertionError
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
react_to_comment(user.id,comment.id,"WOW")
#Assert
reaction_1=Reaction.objects.all()
> assert reaction_1[0].reaction=="WOW"
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:314:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
return self._result_cache[k]
if isinstance(k, slice):
qs = self._chain()
if k.start is not None:
start = int(k.start)
else:
start = None
if k.stop is not None:
stop = int(k.stop)
else:
stop = None
qs.query.set_limits(start, stop)
return list(qs)[::k.step] if k.step else qs
qs = self._chain()
qs.query.set_limits(k, k + 1)
qs._fetch_all()
> return qs._result_cache[0]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:314: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.407168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.420966) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.481630) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.483628) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.498025) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.055396) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.518397) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.519302) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.520993) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.525691) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.526853) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.528434) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.542824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.561937) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.580758) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.055505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.601674) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.602208) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.623569) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.624119) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.055549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.655846) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.656388) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.676440) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.676987) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.697044) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.697737) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.055642) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.719598) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.720115) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.720651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.055664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.813026) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.813559) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.814126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.895895) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.896461) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.897005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.897522) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.902644) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.903121) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.909629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.910145) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.910625) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.917082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.917577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.922558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.932839) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.938245) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.938691) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.945722) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.946182) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.956472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.956906) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.966498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.966968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.055813) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.056040) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.056040) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.056213) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.056213) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.056213) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.056385) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.056385) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.056385) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.056556) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.056556) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
================== 2 failed, 45 passed, 67 warnings in 1.17s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 19
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -104,7 +104,7 @@
#task 8
def get_reaction_metrics(post_id):
post_1=Post.objects.filter(id=post_id)
- if not post_1:
+ if not not post_1:
raise InvalidPostException
a=Reaction.objects.filter(post_id=post_id).values_list("reaction").annotate(Count("reaction"))
return dict(a)============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...........................FFF................. [100%]
=================================== FAILURES ===================================
_________________ test_get_reaction_metrics_for_given_post_id __________________
post = <Post: Post object (1)>, reaction2 = <Reaction: Reaction object (1)>
@pytest.mark.django_db
def test_get_reaction_metrics_for_given_post_id(post,reaction2):
#Arrange
#Act
> a=get_reaction_metrics(post_id=post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:330:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post_id = 1
def get_reaction_metrics(post_id):
post_1=Post.objects.filter(id=post_id)
if not not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:108: InvalidPostException
__________ test_get_reaction_metrics_for_given_post_id_more_than_one ___________
post = <Post: Post object (1)>, reaction2 = <Reaction: Reaction object (1)>
reaction3 = <Reaction: Reaction object (2)>
@pytest.mark.django_db
def test_get_reaction_metrics_for_given_post_id_more_than_one(post,reaction2,reaction3):
#Arrange
#Act
> a=get_reaction_metrics(post_id=post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:338:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post_id = 1
def get_reaction_metrics(post_id):
post_1=Post.objects.filter(id=post_id)
if not not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:108: InvalidPostException
_____ test_get_reaction_metrics_for_given_post_id_raises_invalid_exception _____
reaction2 = <Reaction: Reaction object (1)>
@pytest.mark.django_db
def test_get_reaction_metrics_for_given_post_id_raises_invalid_exception(reaction2):
#Arrange
#Act
with pytest.raises(InvalidPostException):
> get_reaction_metrics(6)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidPostException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:347: Failed
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.411966) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.425793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.486060) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.488017) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.502299) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.070259) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.522215) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.522990) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.524479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.529726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.530885) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.532471) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.546969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.566397) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.586270) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.070373) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.607369) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.607838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.628377) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.628868) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.070417) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.658702) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.659190) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.678138) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.678617) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.697844) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.698558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.070505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.719284) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.719773) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.720298) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.741274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.741777) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.742323) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.070554) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.763611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.764115) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.764630) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.765131) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.770109) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.770599) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.857346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.857929) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.858425) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.882687) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.883204) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.901875) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.911996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.917302) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.917747) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.924484) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.924927) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.934752) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.935192) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.944390) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.944826) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.070687) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.070906) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.070906) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.071067) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.071067) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.071067) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.071226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.071226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.071226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.071382) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.071382) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_reaction_metrics_for_given_post_id - fb_pos...
FAILED fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
FAILED fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
================== 3 failed, 44 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 20
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -113,7 +113,7 @@
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
- if not post_1:
+ if not not post_1:
raise InvalidPostException
if post_1[0].posted_by_id==user_id:
post_1[0].delete()============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................FFF.............. [100%]
=================================== FAILURES ===================================
__________ test_delete_post_for_user_id_raises_invalid_user_exception __________
post = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_user_id_raises_invalid_user_exception(post):
#Arrange
#Act
with pytest.raises(InvalidUserException):
> delete_post(7,post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:356:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 7, post_id = 1
def delete_post(user_id, post_id):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
if not not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:117: InvalidPostException
__________ test_delete_post_for_post_id_raises_invalid_post_exception __________
user = <User: User object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_raises_invalid_post_exception(user):
#Arrange
#Act
with pytest.raises(InvalidPostException):
> delete_post(user.id,5)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:365:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:118: in delete_post
if post_1[0].posted_by_id==user_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet []>, k = 0
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1
def delete_post(user_id, post_id):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
if not not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:117: InvalidPostException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.614532) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.628047) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.688706) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.690673) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.704022) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.264796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.723112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.723922) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.725444) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.729875) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.730963) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.732430) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.746821) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.764738) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.783030) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.264912) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.803077) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.803543) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.823573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.824072) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.264960) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.852955) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.853419) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.871839) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.872299) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.890281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.890877) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.265050) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.911180) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.911651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.912143) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.931833) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.932293) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.932787) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.265093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.952838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.953285) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.953785) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.954282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.958756) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.959207) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.965124) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.965590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.966066) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.972185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.972624) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.977099) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.129723) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.154012) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.154510) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.161595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.162031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.172251) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.172698) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.182060) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.182491) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.265223) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.265450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.265450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.265625) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.265625) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.265625) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.265796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.265796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.265796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.265980) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.265980) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_delete_post_for_post_id_raises_invalid_post_exception
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 3 failed, 44 passed, 67 warnings in 1.17s ===================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/AddNot, occurrence: 21
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -115,7 +115,7 @@
if not post_1:
raise InvalidPostException
- if post_1[0].posted_by_id==user_id:
+ if not post_1[0].posted_by_id==user_id:
post_1[0].delete()
if not user_1:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.072947) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.085837) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.144812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.146788) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.160852) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.722000) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.180009) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.180805) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.182362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.187699) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.188781) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.190307) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.203856) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.222369) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.240971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.722108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.261277) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.261765) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.281961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.282457) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.722149) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.311727) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.312205) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.330853) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.331322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.349768) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.350389) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.722224) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.370612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.371086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.371605) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.391693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.392163) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.392679) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.722266) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.413609) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.414125) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.414629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.415124) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.419884) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.420357) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.426570) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.427048) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.427527) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.433664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.434175) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.438996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.451099) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.458064) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.458530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.465482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.465970) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.475423) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.475884) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.485001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.485484) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.722392) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.722617) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.722617) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.722775) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.722775) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.722775) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.722929) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.722929) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.722929) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.723093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.723093) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.01s ========================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 22
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -118,7 +118,7 @@
if post_1[0].posted_by_id==user_id:
post_1[0].delete()
- if not user_1:
+ if not not user_1:
raise InvalidUserException
if post_1[0].posted_by_id!=user_id:
raise UserCannotDeletePostException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................F.F.............. [100%]
=================================== FAILURES ===================================
__________ test_delete_post_for_user_id_raises_invalid_user_exception __________
post = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_user_id_raises_invalid_user_exception(post):
#Arrange
#Act
with pytest.raises(InvalidUserException):
> delete_post(7,post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:356:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 7, post_id = 1
def delete_post(user_id, post_id):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
if not post_1:
raise InvalidPostException
if post_1[0].posted_by_id==user_id:
post_1[0].delete()
if not not user_1:
raise InvalidUserException
if post_1[0].posted_by_id!=user_id:
> raise UserCannotDeletePostException
E fb_post.exceptions.UserCannotDeletePostException
fb_post/utils.py:124: UserCannotDeletePostException
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1, post_id = 1
def delete_post(user_id, post_id):
user_1=User.objects.filter(id=user_id)
post_1=Post.objects.filter(id=post_id)
if not post_1:
raise InvalidPostException
if post_1[0].posted_by_id==user_id:
post_1[0].delete()
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:122: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.123299) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.136239) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.191421) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.193315) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.208115) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.775175) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.227452) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.228272) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.229828) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.235150) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.236282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.237811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.250964) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.269269) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.288219) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.775283) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.309052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.309568) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.330845) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.331303) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.775326) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.361577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.362096) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.381168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.381674) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.400512) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.401137) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.775411) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.421730) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.422240) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.422771) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.442974) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.443461) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.444006) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.775455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.463997) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.464429) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.464926) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.465428) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.470187) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.470661) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.476770) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.477252) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.477734) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.483911) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.484380) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.489030) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.584437) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.609364) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.609851) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.617075) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.617529) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.627866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.628312) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.637811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.638285) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.775587) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.775808) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.775808) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.775969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.775969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.775969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.776131) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.776131) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.776131) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.776288) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.776288) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 2 failed, 45 passed, 67 warnings in 1.11s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 23
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -120,7 +120,7 @@
if not user_1:
raise InvalidUserException
- if post_1[0].posted_by_id!=user_id:
+ if not post_1[0].posted_by_id!=user_id:
raise UserCannotDeletePostException
#task 10============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ................................F.............. [100%]
=================================== FAILURES ===================================
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.UserCannotDeletePostException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374: Failed
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.416475) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.430918) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.491690) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.493680) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.508007) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.066171) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.528056) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.528934) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.530613) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.536398) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.537536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.539199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.553444) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.572564) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.592282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.066283) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.613305) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.613838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.635064) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.635577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.066330) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.666646) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.667191) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.686536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.687056) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.705935) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.706557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.066420) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.727398) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.727896) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.728428) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.749206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.749724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.750281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.066467) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.771283) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.771750) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.772235) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.772696) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.777190) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.777653) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.783743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.784255) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.784746) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.791030) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.791516) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.796472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.806487) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.890680) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.891174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.898591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.899040) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.909307) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.909751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.919148) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.919601) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.066596) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.066829) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.066829) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.066998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.066998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.066998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.067169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.067169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.067169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.067333) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.067333) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 1 failed, 46 passed, 67 warnings in 1.11s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 24
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -136,7 +136,7 @@
#task 11
def get_posts_reacted_by_user(user_id):
user_1=User.objects.filter(id=user_id)
- if not user_1:
+ if not not user_1:
raise InvalidUserException
reaction_1=Reaction.objects.filter(reacted_by=user_id)
post_list=[]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...................................FF.......... [100%]
=================================== FAILURES ===================================
_________ test_get_posts_reacted_by_user_raises_invalid_user_exception _________
@pytest.mark.django_db
def test_get_posts_reacted_by_user_raises_invalid_user_exception():
#Arrange
#Act
with pytest.raises(InvalidUserException):
> get_posts_reacted_by_user(user_id=1)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidUserException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:417: Failed
_________ test_get_posts_reacted_by_user_for_valid_details_of_user_id __________
user = <User: User object (1)>, reaction2 = <Reaction: Reaction object (1)>
@pytest.mark.django_db
def test_get_posts_reacted_by_user_for_valid_details_of_user_id(user,reaction2):
#Arrange
#Act
> a=get_posts_reacted_by_user(user_id=user.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:425:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
user_id = 1
def get_posts_reacted_by_user(user_id):
user_1=User.objects.filter(id=user_id)
if not not user_1:
> raise InvalidUserException
E fb_post.exceptions.InvalidUserException
fb_post/utils.py:140: InvalidUserException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.373033) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.387360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.447975) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.449893) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.463682) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.020531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.482809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.483609) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.485160) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.489605) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.490771) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.492357) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.507531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.525838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.545186) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.020636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.566216) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.566719) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.587711) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.588223) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.020681) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.619149) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.619691) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.638906) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.639434) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.659033) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.659724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.020768) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.680780) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.681282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.681811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.702557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.703071) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.703600) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.020810) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.724683) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.725170) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.725687) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.726204) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.731021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.731503) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.737659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.738165) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.738657) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.744888) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.745362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.750171) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.759909) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.765088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.765517) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.772322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.772739) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.861275) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.861780) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.891022) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.891528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.020939) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.021178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.021178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.021351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.021351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.021351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.021522) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.021522) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.021522) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.021691) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:13.021691) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_posts_reacted_by_user_raises_invalid_user_exception
FAILED fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
================== 2 failed, 45 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 25
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -148,7 +148,7 @@
#task 12
def get_reactions_to_post(post_id):
post_1=Post.objects.filter(id=post_id)
- if not post_1:
+ if not not post_1:
raise InvalidPostException
reactions_of_post=Reaction.objects.filter(post_id=post_id)
post_list=[]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .....................................FF........ [100%]
=================================== FAILURES ===================================
___________ test_get_reactions_to_post_raises_invalid_post_exception ___________
@pytest.mark.django_db
def test_get_reactions_to_post_raises_invalid_post_exception():
#Arrange
#Act
with pytest.raises(InvalidPostException):
> get_reactions_to_post(post_id=3)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidPostException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:434: Failed
______________ test_get_reactions_to_post_for_valid_post_details _______________
post = <Post: Post object (1)>, reaction2 = <Reaction: Reaction object (1)>
@pytest.mark.django_db
def test_get_reactions_to_post_for_valid_post_details(post,reaction2):
#Arrange
#Act
> a=get_reactions_to_post(post_id=post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:441:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post_id = 1
def get_reactions_to_post(post_id):
post_1=Post.objects.filter(id=post_id)
if not not post_1:
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:152: InvalidPostException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.059567) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.073171) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.133054) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.134940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.148499) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.713734) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.167840) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.168664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.170275) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.175873) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.176973) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.178514) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.192195) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.211019) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.230113) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.713850) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.250601) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.251086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.271743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.272231) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.713886) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.302433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.302943) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.321611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.322132) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.341167) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.341809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.713970) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.362643) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.363128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.363651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.383911) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.384415) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.384937) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.714007) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.406111) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.406608) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.407133) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.407637) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.412423) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.412898) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.419172) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.419659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.420139) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.426439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.426916) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.431762) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.441628) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.446872) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.447312) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.454219) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.454645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.464550) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.464989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.552661) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.553161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.714120) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.714358) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.714358) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.714530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.714530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.714530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.714696) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.714696) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.714696) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.714864) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.714864) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_reactions_to_post_raises_invalid_post_exception
FAILED fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details - ...
================== 2 failed, 45 passed, 67 warnings in 1.12s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 26
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -168,7 +168,7 @@
for comment in list(post.comments.all()):
reply_list=[]
for reply in list(post.comments.all()):
- if reply.parent_comment_id == comment.id:
+ if not reply.parent_comment_id == comment.id:
replies ={
"comment_id": reply.id,
"commenter": {============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:37.402688', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:37.402688', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:37.402842', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:37.402842', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:37.402993', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:37.402993', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.745622) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.759363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.816493) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.818402) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.832596) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.402090) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.851374) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.852146) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.853651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.859262) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.860443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.862079) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.876227) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.895145) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.914277) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.402193) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.934735) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.935206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.955928) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.956438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.402232) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.986815) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.987334) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.006510) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.007030) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.026065) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.026708) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.402310) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.047371) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.047799) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.048266) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.068349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.068858) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.069389) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.402351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.090199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.090686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.091206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.091716) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.096531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.097022) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.103166) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.103652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.104152) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.110228) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.110704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.115510) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.125264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.130558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.131005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.137761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.138187) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.148048) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.148500) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.157851) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.158309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.402478) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.402688) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.402688) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.402842) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.402842) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.402842) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.402993) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.402993) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.402993) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.403144) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.403144) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 27
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -184,7 +184,7 @@
}
}
reply_list.append(replies)
- if not comment.parent_comment_id:
+ if not not comment.parent_comment_id:
comment = {
"comment_id": comment.id,
"commenter": {============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 5 identical items, use -vv to show
E Differing items:
E {'comments': []} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:17.426571', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E {'comments_count': 0} != {'comments_count': 1}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'thanks for ur wishes', 'comment_id': 2, 'commented_at': '2020-04-20 10:39:17.426743', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:17.426743', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:39:17.426917', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:39:17.426917', 'comment_content': 'thanks for ur wishes', 'reactions': {'count': 0, 'type': []}, 'replies_count': 0, 'replies': []}], 'comments_count': 1} != {'post_id': 1, 'posted_by': {'name': 'sr...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.781633) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.795857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.856287) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.858328) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.872705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.425946) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.891723) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.892581) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.894216) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.899976) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.901156) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.902804) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.917109) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.935945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.954624) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.426049) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.975381) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.975885) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.997026) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.997552) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.426094) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.028466) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.028991) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.048340) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.048875) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.068212) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.068870) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.426175) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.089398) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.089886) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.090425) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.110767) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.111255) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.111774) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.426217) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.132749) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.133258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.133782) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.134309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.139001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.139448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.145688) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.146191) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.146673) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.152707) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.153184) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.157981) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.167844) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.173136) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.173574) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.180533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.180971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.191314) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.191782) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.201043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.201477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.426343) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.426571) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.426571) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.426743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.426743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.426743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.426917) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.426917) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:17.426917) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:17.427083) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:17.427083) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.16s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 28
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -241,7 +241,7 @@
posted_by_id = user_id
)
)
- if not post:
+ if not not post:
if not User.objects.filter(pk = user_id).exists():
raise InvalidUserException
res_list = []============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...........................................F... [100%]
=================================== FAILURES ===================================
________ test_get_user_posts_for_user_id_raises_invalid_user_exception _________
@pytest.mark.django_db
def test_get_user_posts_for_user_id_raises_invalid_user_exception():
#Arrange
#Act
with pytest.raises(InvalidUserException):
> get_user_posts(7)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidUserException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:559: Failed
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.809549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.823200) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.882016) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.883957) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.897462) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.459914) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.916346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.917174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.918751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.924190) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.925319) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.926893) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.940035) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.958536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.977200) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.460026) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.997408) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.997879) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.018174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.018656) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.460074) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.047914) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.048418) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.067470) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.068005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.086955) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.087588) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.460161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.106243) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.106688) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.107174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.126423) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.126936) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.127443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.460209) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.146712) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.147191) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.147693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.148166) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.153034) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.153540) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.159693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.160153) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.160613) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.166760) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.167212) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.171755) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.181214) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.186574) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.187047) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.193894) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.194335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.204086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.204530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.213318) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.213725) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.460335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.460565) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.460565) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.460735) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.460735) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.460735) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.460908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.460908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.460908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.461080) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.461080) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_user_posts_for_user_id_raises_invalid_user_exception
================== 1 failed, 46 passed, 67 warnings in 1.09s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 29
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -242,7 +242,7 @@
)
)
if not post:
- if not User.objects.filter(pk = user_id).exists():
+ if not not User.objects.filter(pk = user_id).exists():
raise InvalidUserException
res_list = []
for p in post:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...........................................F... [100%]
=================================== FAILURES ===================================
________ test_get_user_posts_for_user_id_raises_invalid_user_exception _________
@pytest.mark.django_db
def test_get_user_posts_for_user_id_raises_invalid_user_exception():
#Arrange
#Act
with pytest.raises(InvalidUserException):
> get_user_posts(7)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidUserException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:559: Failed
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.699889) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.712905) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.771140) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.772983) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.786804) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.351863) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.806116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.806952) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.808523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.813117) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.814275) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.815822) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.830717) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.849340) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.867431) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.351977) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.886783) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.887230) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.907293) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.907772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.352023) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.937409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.937893) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.956765) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.957262) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.975583) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.976193) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.352117) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.995897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.996364) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.996862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.016890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.017361) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.017850) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.352161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.038062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:04.038527) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.039005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.039474) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.044022) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.044466) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.050643) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.051112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.051562) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.057770) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.058258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.062880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.072349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.077427) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.077838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.084756) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.085193) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.094973) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.095404) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:04.104751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:04.105197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.352290) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.352518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.352518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.352687) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.352687) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.352687) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.352858) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.352858) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.352858) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.353026) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.353026) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_user_posts_for_user_id_raises_invalid_user_exception
================== 1 failed, 46 passed, 67 warnings in 1.06s ===================
worker outcome: normal
test outcome: killed
operator: core/AddNot, occurrence: 30
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -253,7 +253,7 @@
#task 15
def get_replies_for_comment(comment_id):
about_comment=Comment.objects.select_related("commented_by").filter(parent_comment_id=comment_id)
- if not about_comment:
+ if not not about_comment:
raise InvalidCommentException
comment_dict={}
comment_list=[]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .............................................FF [100%]
=================================== FAILURES ===================================
___ test_get_replies_for_comment_comment_id_raises_invalid_comment_exception ___
@pytest.mark.django_db
def test_get_replies_for_comment_comment_id_raises_invalid_comment_exception():
#Arrange
#Act
with pytest.raises(InvalidCommentException):
> get_replies_for_comment(6)
E Failed: DID NOT RAISE <class 'fb_post.exceptions.InvalidCommentException'>
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:609: Failed
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
e=reply_to_comment(d.id,b, "Thanks for ur wishes")
#Assert
> assert get_replies_for_comment(b)== [{
"comment_id": 2,
"commenter": {
"user_id": 1,
"name": "srinu",
"profile_pic": "www.facebook.com"
},
"commented_at": str(datetime.now()),
"comment_content": "Thanks for ur wishes",
}]
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:621:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
comment_id = 1
def get_replies_for_comment(comment_id):
about_comment=Comment.objects.select_related("commented_by").filter(parent_comment_id=comment_id)
if not not about_comment:
> raise InvalidCommentException
E fb_post.exceptions.InvalidCommentException
fb_post/utils.py:257: InvalidCommentException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.168932) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.183081) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.243854) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.245838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.259803) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.822207) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.279077) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.279885) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.281438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.287009) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.288162) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.289757) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.303717) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.322830) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.341675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.822322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.361479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.361970) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.382471) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.382966) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.822368) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.413502) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.414053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.433433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.433962) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.453125) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.453801) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.822456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.474342) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.474820) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.475339) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.495516) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.495980) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.496481) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.822503) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.517160) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.517633) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.518161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.518660) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.523433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.523915) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.529959) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.530445) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.530920) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.537070) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.537539) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.542363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.552082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.557397) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.557835) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.564776) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.565201) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.575200) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.575653) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.584948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.585387) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.822631) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.822866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.822866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.823039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.823039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.823039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.823211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.823211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.823211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.823383) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.823383) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_replies_for_comment_comment_id_raises_invalid_comment_exception
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 2 failed, 45 passed, 67 warnings in 1.12s ===================
worker outcome: normal
test outcome: killed
operator: core/ReplaceTrueWithFalse, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -129,7 +129,7 @@
negative=["SAD","ANGRY","THUMBS-DOWN"]
pos=Count('reaction',filter=Q(reaction__in=positive))
neg=Count("reaction",filter=Q(reaction__in=negative))
- total=Reaction.objects.annotate(pos=pos).annotate(neg=neg).filter(pos__gt=F('neg')).values_list("post_id",flat=True).distinct()
+ total=Reaction.objects.annotate(pos=pos).annotate(neg=neg).filter(pos__gt=F('neg')).values_list("post_id",flat=False).distinct()
return total
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .................................F............. [100%]
=================================== FAILURES ===================================
_________ test_get_posts_with_more_positive_reactions_returns_post_ids _________
reaction2 = <Reaction: Reaction object (1)>
@pytest.mark.django_db
def test_get_posts_with_more_positive_reactions_returns_post_ids(reaction2):
#Arrange
#Act
a=get_posts_with_more_positive_reactions()
#Assert
> assert list(a)==[1]
E assert [(1,)] == [1]
E At index 0 diff: (1,) != 1
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:393: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.709290) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.723581) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.782452) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.784279) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.797812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.360555) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.817061) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.817871) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.819406) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.823785) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.824857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.826373) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.840901) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.859105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.877498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.360667) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.898021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.898504) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.919221) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.919721) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.360716) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.949811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.950325) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.968578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.969062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.987711) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.988318) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.360799) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.008921) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.009399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.009927) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.030207) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.030698) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.031207) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.360843) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.051312) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.051753) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.052241) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.052715) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.057177) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.057623) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.063386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.063876) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.064347) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.070335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.070779) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.075311) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.084772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.089756) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.090184) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.167572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.168038) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.177935) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.178354) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.187433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.187862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.360972) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.361196) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.361196) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.361365) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.361365) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.361365) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.361536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.361536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.361536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.361701) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.361701) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
================== 1 failed, 46 passed, 67 warnings in 1.07s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -39,7 +39,7 @@
raise InvalidCommentException
if not reply_content:
raise InvalidReplyContent
- if comment[0].parent_comment_id:
+ if comment[ 1].parent_comment_id:
reply_comment=Comment.objects.create(content=reply_content,
commented_by_id=user_id,
commented_at=datetime.now(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..........FFE..............................F.F.F [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7f0537b69828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.parent_comment_id contains a value '2' that does not have a corresponding value in fb_post_comment.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id(user,post):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:42: in reply_to_comment
if comment[ 1].parent_comment_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
user2 = <User: User object (2)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id(user,post,user2):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id,parent_comment_id=user2.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:42: in reply_to_comment
if comment[ 1].parent_comment_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:519:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:42: in reply_to_comment
if comment[ 1].parent_comment_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:568:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:42: in reply_to_comment
if comment[ 1].parent_comment_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> e=reply_to_comment(d.id,b, "Thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:619:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:42: in reply_to_comment
if comment[ 1].parent_comment_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.179036) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.192224) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.246581) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.248604) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.262478) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.831952) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.281054) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.281994) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.408046) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.409284) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.542084) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.561636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.580896) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.832053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.602216) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.602721) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.624182) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.624717) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.832091) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.655626) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.656123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.675497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.676031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.695663) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.696338) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.832168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.718245) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.718753) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.719290) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.740654) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.741194) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.741734) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.832207) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.763545) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.764068) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.764578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.765067) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.769941) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.770413) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.777337) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.777854) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.778362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.784555) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.785032) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.789834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.799834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.805050) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.805480) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.812311) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.812730) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.822804) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.823242) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.832385) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.832813) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.832324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.832526) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.832526) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.832664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.832664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.832798) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.832798) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.832927) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.832927) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
ERROR fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
============== 5 failed, 42 passed, 63 warnings, 1 error in 1.47s ==============
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -39,7 +39,7 @@
raise InvalidCommentException
if not reply_content:
raise InvalidReplyContent
- if comment[0].parent_comment_id:
+ if comment[ -1].parent_comment_id:
reply_comment=Comment.objects.create(content=reply_content,
commented_by_id=user_id,
commented_at=datetime.now(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..........FFE..............................F.F.F [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7fa37e833828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.parent_comment_id contains a value '2' that does not have a corresponding value in fb_post_comment.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id(user,post):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:42: in reply_to_comment
if comment[ -1].parent_comment_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
user2 = <User: User object (2)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id(user,post,user2):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id,parent_comment_id=user2.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:42: in reply_to_comment
if comment[ -1].parent_comment_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:519:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:42: in reply_to_comment
if comment[ -1].parent_comment_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:568:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:42: in reply_to_comment
if comment[ -1].parent_comment_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> e=reply_to_comment(d.id,b, "Thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:619:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:42: in reply_to_comment
if comment[ -1].parent_comment_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.423859) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.437941) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.498275) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.500276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.514621) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.066531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.534788) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.535640) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.666334) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.667572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.804482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.821536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.839815) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.066625) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.860412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.860897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.882053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.882564) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.066661) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.913553) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.914073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.933183) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.933696) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.952790) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.953427) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.066738) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.973812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.974294) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.974793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.994457) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.994925) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.995423) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.066778) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.015964) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.016458) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.016974) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.017474) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.022345) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.022826) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.029613) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.030148) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.030633) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.036431) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.036882) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.041403) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.050990) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.056098) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.056501) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.063196) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.063624) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.073381) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.073817) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.082486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.082898) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.066900) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.067139) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.067139) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.067312) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.067312) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.067488) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.067488) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.067651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.067651) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
ERROR fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
============== 5 failed, 42 passed, 63 warnings, 1 error in 1.47s ==============
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -43,7 +43,7 @@
reply_comment=Comment.objects.create(content=reply_content,
commented_by_id=user_id,
commented_at=datetime.now(),
- post_id=comment[0].post_id,
+ post_id=comment[ 1].post_id,
parent_comment_id=comment[0].parent_comment_id)
else:
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...........FE................................... [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7f3e64252828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.parent_comment_id contains a value '2' that does not have a corresponding value in fb_post_comment.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
user2 = <User: User object (2)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id(user,post,user2):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id,parent_comment_id=user2.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:46: in reply_to_comment
post_id=comment[ 1].post_id,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.780018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.794243) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.852832) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.854805) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.868653) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.422662) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.888138) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.888955) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.890537) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.896013) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.897180) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.091651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.109746) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.127760) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.422778) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.147448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.147914) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.167939) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.168416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.422824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.197218) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.197694) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.216101) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.216577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.234732) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.235337) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.422916) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.255085) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.255542) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.256039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.275450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.275913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.276415) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.422961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.296167) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.296618) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.297110) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.297587) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.302142) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.302611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.308537) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.309015) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.309478) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.315628) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.316107) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.320821) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.330725) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.335974) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.336409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.343220) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.343652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.353825) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.354317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.363684) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.364138) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.423098) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.423316) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.423316) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.423474) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.423474) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.423474) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.423636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.423636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.423636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.423806) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.423806) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
ERROR fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
============== 1 failed, 46 passed, 66 warnings, 1 error in 1.20s ==============
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -43,7 +43,7 @@
reply_comment=Comment.objects.create(content=reply_content,
commented_by_id=user_id,
commented_at=datetime.now(),
- post_id=comment[0].post_id,
+ post_id=comment[ -1].post_id,
parent_comment_id=comment[0].parent_comment_id)
else:
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...........FE................................... [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7fc0b1308828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.parent_comment_id contains a value '2' that does not have a corresponding value in fb_post_comment.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
user2 = <User: User object (2)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id(user,post,user2):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id,parent_comment_id=user2.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:46: in reply_to_comment
post_id=comment[ -1].post_id,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.930058) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.943790) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.003800) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.005712) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.019292) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.586982) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.038661) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.039471) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.041019) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.046425) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.047551) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.246357) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.265192) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.283637) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.587094) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.303968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.304481) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.325684) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.326199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.587139) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.356477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.356963) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.376064) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.376559) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.395487) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.396163) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.587229) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.417404) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.417921) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.418449) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.439554) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.440069) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.440596) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.587278) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.462256) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.462756) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.463276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.463792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.468783) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.469281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.475718) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.476204) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.476672) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.482999) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.483476) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.488351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.498518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.503980) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.504460) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.511451) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.511889) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.521894) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.522356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.531372) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.531803) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.587406) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.587632) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.587632) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.587800) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.587800) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.587800) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.587969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.587969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.587969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.588133) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.588133) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
ERROR fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
============== 1 failed, 46 passed, 66 warnings, 1 error in 1.19s ==============
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 4
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -44,7 +44,7 @@
commented_by_id=user_id,
commented_at=datetime.now(),
post_id=comment[0].post_id,
- parent_comment_id=comment[0].parent_comment_id)
+ parent_comment_id=comment[ 1].parent_comment_id)
else:
reply_comment=Comment.objects.create(content=reply_content,============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...........FE................................... [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7f64ce686828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.parent_comment_id contains a value '2' that does not have a corresponding value in fb_post_comment.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
user2 = <User: User object (2)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id(user,post,user2):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id,parent_comment_id=user2.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:47: in reply_to_comment
parent_comment_id=comment[ 1].parent_comment_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.124957) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.138721) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.199366) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.201267) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.214996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.776062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.234610) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.235437) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.237028) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.241493) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.242635) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.441450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.460623) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.479557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.776158) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.499973) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.500465) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.521221) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.521694) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.776195) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.551564) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.552043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.570812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.571278) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.589681) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.590318) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.776274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.610349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.610826) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.611340) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.631511) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.631992) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.632499) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.776307) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.653325) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.653791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.654309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.654792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.659299) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.659755) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.665726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.666219) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.666689) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.672734) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.673217) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.677891) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.687507) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.692674) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.693109) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.699981) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.700415) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.710455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.710889) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.720215) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.720684) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.776416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.776617) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.776617) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.776750) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.776750) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.776750) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.776890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.776890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:11.776890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:11.777030) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:11.777030) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
ERROR fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
============== 1 failed, 46 passed, 66 warnings, 1 error in 1.21s ==============
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 5
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -44,7 +44,7 @@
commented_by_id=user_id,
commented_at=datetime.now(),
post_id=comment[0].post_id,
- parent_comment_id=comment[0].parent_comment_id)
+ parent_comment_id=comment[ -1].parent_comment_id)
else:
reply_comment=Comment.objects.create(content=reply_content,============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ...........FE................................... [100%]
==================================== ERRORS ====================================
_ ERROR at teardown of test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
self = <django.test.testcases.TestCase testMethod=__init__>
def _post_teardown(self):
"""
Perform post-test things:
* Flush the contents of the database to leave a clean slate. If the
class has an 'available_apps' attribute, don't fire post_migrate.
* Force-close the connection so the next test gets a clean cursor.
"""
try:
> self._fixture_teardown()
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1009:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/ubuntu/.venv/lib/python3.6/site-packages/django/test/testcases.py:1177: in _fixture_teardown
connections[db_name].check_constraints()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <django.db.backends.sqlite3.base.DatabaseWrapper object at 0x7faf6c12d828>
table_names = None
def check_constraints(self, table_names=None):
"""
Check each table name in `table_names` for rows with invalid foreign
key references. This method is intended to be used in conjunction with
`disable_constraint_checking()` and `enable_constraint_checking()`, to
determine if rows with invalid references were entered while constraint
checks were off.
"""
if self.features.supports_pragma_foreign_key_check:
with self.cursor() as cursor:
if table_names is None:
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
else:
violations = chain.from_iterable(
cursor.execute('PRAGMA foreign_key_check(%s)' % table_name).fetchall()
for table_name in table_names
)
# See https://www.sqlite.org/pragma.html#pragma_foreign_key_check
for table_name, rowid, referenced_table_name, foreign_key_index in violations:
foreign_key = cursor.execute(
'PRAGMA foreign_key_list(%s)' % table_name
).fetchall()[foreign_key_index]
column_name, referenced_column_name = foreign_key[3:5]
primary_key_column_name = self.introspection.get_primary_key_column(cursor, table_name)
primary_key_value, bad_value = cursor.execute(
'SELECT %s, %s FROM %s WHERE rowid = %%s' % (
primary_key_column_name, column_name, table_name
),
(rowid,),
).fetchone()
raise utils.IntegrityError(
"The row in table '%s' with primary key '%s' has an "
"invalid foreign key: %s.%s contains a value '%s' that "
"does not have a corresponding value in %s.%s." % (
table_name, primary_key_value, table_name, column_name,
> bad_value, referenced_table_name, referenced_column_name
)
)
E django.db.utils.IntegrityError: The row in table 'fb_post_comment' with primary key '1' has an invalid foreign key: fb_post_comment.parent_comment_id contains a value '2' that does not have a corresponding value in fb_post_comment.id.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py:331: IntegrityError
=================================== FAILURES ===================================
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
user2 = <User: User object (2)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id(user,post,user2):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id,parent_comment_id=user2.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:171:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:47: in reply_to_comment
parent_comment_id=comment[ -1].parent_comment_id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.299811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.313714) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.374427) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.376372) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.390412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.949502) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.410229) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.411088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.412665) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.417457) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.418654) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.617007) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.635916) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.655181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.949616) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.676013) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.676500) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.697848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.698387) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.949668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.729500) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.730046) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.749814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.750372) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.769542) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.770201) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.949761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.791127) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.791612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.792142) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.812414) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.812890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.813411) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.949812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.834245) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.834727) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.835240) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.835740) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.840517) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.840962) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.847059) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.847530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.848000) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.854122) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.854597) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.859380) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.869068) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.874234) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.874660) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.881385) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.881807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.891377) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.891793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.900836) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.901267) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.949981) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.950232) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.950232) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.950409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.950409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.950409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.950584) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.950584) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.950584) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.950752) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.950752) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
ERROR fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
============== 1 failed, 46 passed, 66 warnings, 1 error in 1.22s ==============
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 6
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -50,7 +50,7 @@
reply_comment=Comment.objects.create(content=reply_content,
commented_by_id=user_id,
commented_at=datetime.now(),
- post_id=comment[0].post_id,
+ post_id=comment[ 1].post_id,
parent_comment_id=comment_id)
return reply_comment.id
#task 5============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..........F...............................F.F.F [100%]
=================================== FAILURES ===================================
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id(user,post):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:53: in reply_to_comment
post_id=comment[ 1].post_id,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:519:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:53: in reply_to_comment
post_id=comment[ 1].post_id,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:568:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:53: in reply_to_comment
post_id=comment[ 1].post_id,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> e=reply_to_comment(d.id,b, "Thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:619:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:53: in reply_to_comment
post_id=comment[ 1].post_id,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.652163) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.666496) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.727062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.728986) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.743057) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.293160) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.762647) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.763485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.890146) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.891418) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.893150) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.907486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.926194) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.944742) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.293274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.964956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.965412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.985183) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.985655) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.293324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.015787) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.016252) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.035057) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.035560) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.054432) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.054940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.293405) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.075238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.075839) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.076354) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.096336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.096805) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.097309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:18.293447) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.117528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.118021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.118519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.118998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.123697) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.124164) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.130120) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.130589) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.131055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.137031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.137483) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.142055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.151532) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.156520) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.156946) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.163847) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.164277) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.173694) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.174134) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.183001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.183428) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.293571) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.293824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.293824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.294012) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.294012) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.294175) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.294175) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:18.294347) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:18.294347) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 4 failed, 43 passed, 64 warnings in 1.35s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 7
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -50,7 +50,7 @@
reply_comment=Comment.objects.create(content=reply_content,
commented_by_id=user_id,
commented_at=datetime.now(),
- post_id=comment[0].post_id,
+ post_id=comment[ -1].post_id,
parent_comment_id=comment_id)
return reply_comment.id
#task 5============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..........F...............................F.F.F [100%]
=================================== FAILURES ===================================
_ test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id _
user = <User: User object (1)>, post = <Post: Post object (1)>
@pytest.mark.django_db
def test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id(user,post):
#Arrange
comment=Comment.objects.create(content="welcome",commented_at=datetime.now(),commented_by_id=user.id,post_id=post.id)
#Act
> comment_2=reply_to_comment(user.id,comment.id,reply_content="welcome")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:53: in reply_to_comment
post_id=comment[ -1].post_id,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:519:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:53: in reply_to_comment
post_id=comment[ -1].post_id,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
> e=reply_to_comment(d.id,b, "thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:568:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:53: in reply_to_comment
post_id=comment[ -1].post_id,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> e=reply_to_comment(d.id,b, "Thanks for ur wishes")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:619:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:53: in reply_to_comment
post_id=comment[ -1].post_id,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Comment: Comment object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.325976) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.339688) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.400765) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.402703) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.416848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.973978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.436615) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.437466) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.565807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.566984) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.568723) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.582547) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.600748) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.618949) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.974083) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.638940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.639420) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.659702) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.660193) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.974129) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.690869) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.691369) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.710994) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.711500) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.730648) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.731170) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.974210) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.752088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.752690) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.753189) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.773365) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.773842) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.774356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:59.974253) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.794643) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.795097) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.795579) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.796048) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.800644) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.801082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.806929) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.807395) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.807848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.813547) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.814022) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.818507) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.827909) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.832741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.833135) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.839565) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.839963) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.849455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.849884) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.858637) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.859041) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.974383) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.974619) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.974619) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.974791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.974791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.974968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.974968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:59.975141) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:59.975141) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 4 failed, 43 passed, 64 warnings in 1.35s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 8
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -67,7 +67,7 @@
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[ 1].reaction==reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .................FF............................ [100%]
=================================== FAILURES ===================================
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"LIT")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:70: in react_to_post
if reaction_2[ 1].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:237:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:70: in react_to_post
if reaction_2[ 1].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.220973) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.235505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.292547) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.294408) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.308396) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.866138) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.326647) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.327543) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.329265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.334005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.335098) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.336595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.351140) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.369081) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.386939) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.866248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.408133) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.408635) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.554482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.555033) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.644403) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.644871) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.664043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.664548) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.683353) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.683873) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.866376) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.704567) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.705266) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.705791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.726080) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.726569) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.727079) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.866416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.747833) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:03.748324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.748839) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.749327) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.754258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.754737) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.760549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.761010) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.761458) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.767307) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.767797) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.772467) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.782396) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.787655) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.788088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.794921) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.795352) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.805186) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.805622) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:03.814742) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:03.815194) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.866543) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.866776) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.866776) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.866945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.866945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.866945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.867108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.867108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:02.867108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:02.867278) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:02.867278) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
================== 2 failed, 45 passed, 66 warnings in 1.21s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 9
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -67,7 +67,7 @@
if not reaction_2:
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[ -1].reaction==reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .................FF............................ [100%]
=================================== FAILURES ===================================
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"LIT")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:70: in react_to_post
if reaction_2[ -1].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:237:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:70: in react_to_post
if reaction_2[ -1].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.299461) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.313331) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.374169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.376077) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.389512) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.943084) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.409482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.410353) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.411969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.416498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.417537) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.418980) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.433599) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.453105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.472780) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.943201) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.493948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.494448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.639640) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.640216) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.729398) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.729970) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.749241) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.749737) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.768532) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.769044) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.943335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.790427) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.791168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.791695) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.813327) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.813851) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.814402) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.943383) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.835982) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:45.836506) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.837027) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.837528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.842698) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.843186) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.849578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.850080) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.850555) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.856673) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.857168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.862001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.872030) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.877322) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.877756) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.884863) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.885320) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.895603) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.896076) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:45.905724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:45.906205) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.943512) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.943740) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.943740) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.943922) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.943922) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.943922) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.944093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.944093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.944093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.944262) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.944262) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
================== 2 failed, 45 passed, 66 warnings in 1.22s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 10
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -68,7 +68,7 @@
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
if reaction_2[0].reaction==reaction_type:
- reaction_2[0].delete()
+ reaction_2[ 1].delete()
else:
reaction_1=reaction_2[0]
reaction_1.reaction=reaction_type============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .................F............................. [100%]
=================================== FAILURES ===================================
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"LIT")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:71: in react_to_post
reaction_2[ 1].delete()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.211915) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.225449) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.283168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.285147) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.299161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.864412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.318635) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.319527) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.321195) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.326062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.327243) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.328838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.344470) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.364316) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.384188) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.864528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.405391) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.405894) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.549361) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.549942) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.864576) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.581092) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.581595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.600934) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.601414) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.620303) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.620940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.864660) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.641433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.641926) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.642447) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.662896) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.663358) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.663878) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.864708) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.684369) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:01.684847) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.685360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.685863) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.690636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.691096) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.697201) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.697689) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.698177) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.704177) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.704649) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.709378) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.719156) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.724351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.724788) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.731577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.731998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.741855) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.742308) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:01.751523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:01.751958) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.864836) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.865061) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.865061) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.865230) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.865230) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.865230) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.865399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.865399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.865399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.865567) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.865567) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
================== 1 failed, 46 passed, 67 warnings in 1.15s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 11
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -68,7 +68,7 @@
Reaction.objects.create(post_id=post_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
if reaction_2[0].reaction==reaction_type:
- reaction_2[0].delete()
+ reaction_2[ -1].delete()
else:
reaction_1=reaction_2[0]
reaction_1.reaction=reaction_type============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .................F............................. [100%]
=================================== FAILURES ===================================
_ test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"LIT")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:71: in react_to_post
reaction_2[ -1].delete()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.437421) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.451693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.512005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.513998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.528128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.085816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.547703) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.548528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.550086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.554675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.555806) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.557363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.572366) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.590624) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.609376) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.085960) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.629506) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.629996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.774580) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.775172) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.086006) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.806940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.807476) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.827008) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.827527) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.846223) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.846855) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.086101) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.867459) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.867938) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.868453) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.888318) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.888834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.889371) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.086149) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.910812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.911310) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.911836) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.912345) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.917220) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.917700) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.923916) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.924398) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.924867) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.930889) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.931368) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.936102) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.945922) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.951061) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.951483) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.958181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.958611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.968515) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.968957) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.978181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.978625) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.086308) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.086560) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.086560) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.086741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.086741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.086741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.086908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.086908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:47.086908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:47.087066) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:47.087066) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
================== 1 failed, 46 passed, 67 warnings in 1.15s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 12
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -70,7 +70,7 @@
if reaction_2[0].reaction==reaction_type:
reaction_2[0].delete()
else:
- reaction_1=reaction_2[0]
+ reaction_1=reaction_2[ 1]
reaction_1.reaction=reaction_type
reaction_1.reacted_at=datetime.now()
reaction_1.save()============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..................F............................ [100%]
=================================== FAILURES ===================================
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:237:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:73: in react_to_post
reaction_1=reaction_2[ 1]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.428466) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.442043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.502508) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.504345) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.517704) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.080622) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.537058) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.537858) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.539410) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.544640) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.545720) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.547227) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.560247) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.578913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.597460) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.080738) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.617537) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.618026) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.638110) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.638590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.788130) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.788626) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.807636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.808126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.827044) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.827538) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.080876) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.848057) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.848671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.849186) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.869386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.869844) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.870356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.080919) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.889950) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.890415) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.890900) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.891374) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.895967) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.896408) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.902115) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.902577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.903031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.909012) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.909476) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.914083) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.923348) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.928203) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.928633) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.935292) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.935711) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.945269) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.945692) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.954764) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.955211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.081050) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.081276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.081276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.081448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.081448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.081448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.081620) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.081620) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:00.081620) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:00.081790) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:00.081790) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
================== 1 failed, 46 passed, 66 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 13
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -70,7 +70,7 @@
if reaction_2[0].reaction==reaction_type:
reaction_2[0].delete()
else:
- reaction_1=reaction_2[0]
+ reaction_1=reaction_2[ -1]
reaction_1.reaction=reaction_type
reaction_1.reacted_at=datetime.now()
reaction_1.save()============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..................F............................ [100%]
=================================== FAILURES ===================================
_ test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, post = <Post: Post object (1)>
reaction2 = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction(user,post,reaction2):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,post_id=post.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_post(user.id,post.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:237:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:73: in react_to_post
reaction_1=reaction_2[ -1]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.542901) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.551615) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.587141) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.588390) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.596998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.262674) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.608614) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.609155) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.610202) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.613577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.614395) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.615415) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.624038) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.635084) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.646045) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.262788) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.657954) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.658275) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.670252) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.670564) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.756598) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.756932) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.768602) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.768917) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.780133) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.780441) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.262920) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.792506) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.792907) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.793252) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.805125) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.805438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.805775) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.262962) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.817722) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.818059) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.818403) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.818733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.821740) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.822073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.825884) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.826233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.826542) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.830319) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.830631) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.833634) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.839904) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.843220) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.843505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.847915) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.848206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.854468) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.854752) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.860656) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.860944) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.263093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.263324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.263324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.263498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.263498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.263498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.263665) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.263665) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.263665) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.263836) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.263836) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
================== 1 failed, 46 passed, 66 warnings in 0.76s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 14
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -90,7 +90,7 @@
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[ 1].reaction==reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................FF..................... [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:300:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:93: in react_to_comment
if reaction_2[ 1].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:311:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:93: in react_to_comment
if reaction_2[ 1].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.051854) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.065486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.124133) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.126043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.139742) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.697856) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.158732) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.159523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.161021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.166299) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.167401) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.168935) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.182771) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.201754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.221238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.697966) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.242096) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.242589) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.263078) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.263546) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.698003) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.292872) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.293355) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.311372) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.311843) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.330420) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.331021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.698072) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.351272) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.351732) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.352238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.494090) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.494615) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.495138) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.572148) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.572666) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.573168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.573643) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.578142) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.578581) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.584646) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.585123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.585592) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.591883) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.592369) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.597056) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.605952) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.610835) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.611234) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.617652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.618102) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.628252) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.628700) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.637650) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.638122) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.698220) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.698432) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.698432) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.698574) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.698574) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.698574) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.698710) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.698710) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.698710) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.698843) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.698843) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
================== 2 failed, 45 passed, 66 warnings in 1.20s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 15
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -90,7 +90,7 @@
if not reaction_2:
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
- if reaction_2[0].reaction==reaction_type:
+ if reaction_2[ -1].reaction==reaction_type:
reaction_2[0].delete()
else:
reaction_1=reaction_2[0]============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................FF..................... [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:300:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:93: in react_to_comment
if reaction_2[ -1].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:311:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:93: in react_to_comment
if reaction_2[ -1].reaction==reaction_type:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.775476) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.789185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.850089) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.852011) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.865971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.419932) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.885323) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.886174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.887709) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.892896) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.893951) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.895357) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.907792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.926031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.944845) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.420046) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.965151) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.965628) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.986144) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.986638) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.420095) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.017076) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.017626) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.036775) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.037296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.055758) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.056363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.420185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.076064) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.076513) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.077002) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.219077) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.219601) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.220118) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.297220) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.297740) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.298274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.298758) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.303572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.304057) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.310349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.310816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.311274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.317121) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.317593) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.322246) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.331607) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.336607) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.337002) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.343379) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.343816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.353410) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.353827) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.362391) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.362797) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.420365) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.420590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.420590) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.420755) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.420755) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.420755) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.420918) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.420918) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:50.420918) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:50.421082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:50.421082) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
================== 2 failed, 45 passed, 66 warnings in 1.20s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 16
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -91,7 +91,7 @@
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
if reaction_2[0].reaction==reaction_type:
- reaction_2[0].delete()
+ reaction_2[ 1].delete()
else:
reaction_1=reaction_2[0]
reaction_1.reaction=reaction_type============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................F...................... [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:300:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:94: in react_to_comment
reaction_2[ 1].delete()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.866558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.880364) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.940793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.942728) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.956676) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.507994) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.976252) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.977102) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.978724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.983346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.984480) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.986037) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.000245) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.019015) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.038146) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.508111) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.058571) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.059061) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.079439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.079922) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.508155) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.109982) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.110488) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.129294) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.129809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.148479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.149090) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.508238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.169594) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.170105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.170636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.315341) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.315898) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.316439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.508280) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.338357) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.338866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.339367) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.339878) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.345052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.345526) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.351770) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.352247) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.352703) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.358813) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.359275) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.364136) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.374433) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.379741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.380168) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.386963) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.387397) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.397558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.398061) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.407772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.408225) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.508413) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.508655) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.508655) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.508839) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.508839) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.508839) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.509018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.509018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.509018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.509200) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.509200) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
================== 1 failed, 46 passed, 67 warnings in 1.15s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 17
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -91,7 +91,7 @@
Reaction.objects.create(comment_id=comment_id,reaction=reaction_type,reacted_by_id=user_id,reacted_at=datetime.now())
else:
if reaction_2[0].reaction==reaction_type:
- reaction_2[0].delete()
+ reaction_2[ -1].delete()
else:
reaction_1=reaction_2[0]
reaction_1.reaction=reaction_type============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................F...................... [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"LOVE")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:300:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:94: in react_to_comment
reaction_2[ -1].delete()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.838961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.852848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.913624) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.915656) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.930119) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.483487) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.950384) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.951270) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.952934) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.958229) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.959294) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.960741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.974986) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.994273) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.012804) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.483602) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.032947) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.033428) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.054048) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.054556) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.483648) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.084481) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.084973) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.103656) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.104136) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.122629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.123245) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.483732) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.143453) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.143944) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.144465) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.288650) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.289215) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.289754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.483787) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.311086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:52.311566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.312094) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.312607) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.317576) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.318075) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.324104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.324578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.325032) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.330959) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.331430) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.336197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.346120) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.351303) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.351743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.358679) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.359119) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.369005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.369444) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:52.378821) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:52.379275) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.483910) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.484134) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.484134) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.484302) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.484302) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.484302) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.484472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.484472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:51.484472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:51.484643) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:51.484643) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
================== 1 failed, 46 passed, 67 warnings in 1.16s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 18
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -93,7 +93,7 @@
if reaction_2[0].reaction==reaction_type:
reaction_2[0].delete()
else:
- reaction_1=reaction_2[0]
+ reaction_1=reaction_2[ 1]
reaction_1.reaction=reaction_type
reaction_1.reacted_at=datetime.now()
reaction_1.save()============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................F..................... [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:311:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:96: in react_to_comment
reaction_1=reaction_2[ 1]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.098836) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.112899) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.171353) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.173305) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.186959) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.750600) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.206734) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.207560) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.209113) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.214761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.215909) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.217470) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.231462) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.250405) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.269264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.750716) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.289785) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.290300) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.311061) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.311559) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.750761) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.341850) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.342348) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.361093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.361588) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.380413) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.381034) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.750848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.401263) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.401748) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.402282) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.423020) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.423515) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.424051) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.568349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.568887) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.569388) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.569879) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.574815) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.575284) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.581613) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.582114) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.582592) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.588538) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.588993) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.593739) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.603631) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.608795) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.609222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.616099) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.616524) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.626486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.626911) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.636152) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.636588) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.751023) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.751250) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.751250) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.751425) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.751425) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.751425) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.751593) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.751593) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.751593) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.751753) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.751753) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
================== 1 failed, 46 passed, 66 warnings in 1.15s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 19
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -93,7 +93,7 @@
if reaction_2[0].reaction==reaction_type:
reaction_2[0].delete()
else:
- reaction_1=reaction_2[0]
+ reaction_1=reaction_2[ -1]
reaction_1.reaction=reaction_type
reaction_1.reacted_at=datetime.now()
reaction_1.save()============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................F..................... [100%]
=================================== FAILURES ===================================
_ test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction _
user = <User: User object (1)>, comment = <Comment: Comment object (1)>
reaction = <Reaction: Reaction object (1)>
@freeze_time(datetime.now())
@pytest.mark.django_db
def test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction(user,comment,reaction):
#reaction_1=Reaction.objects.create(reacted_by_id=user.id,comment_id=comment.id,reaction="LOVE",reacted_at=datetime.now())
#Arrange
#Act
> react_to_comment(user.id,comment.id,"WOW")
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:311:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:96: in react_to_comment
reaction_1=reaction_2[ -1]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Reaction: Reaction object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.238170) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.251841) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.312159) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.314160) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.328274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.890332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.347781) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.348611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.350226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.354825) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.355917) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.357490) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.372633) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.391831) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.410660) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.890434) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.431595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.432091) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.453540) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.454073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.890471) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.483686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.484196) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.503106) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.503588) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.522908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.523557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.890544) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.544730) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.545243) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.545782) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.566900) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.567423) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.567959) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.712571) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.713103) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.713630) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.714167) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.719100) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.719569) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.726149) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.726625) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.727085) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.733260) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.733730) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.738671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.748830) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.754181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.754602) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.761512) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.761967) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.772279) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.772716) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.781860) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.782335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.890699) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.890907) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.890907) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.891055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.891055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.891055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.891197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.891197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:55.891197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:55.891336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:55.891336) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
================== 1 failed, 46 passed, 66 warnings in 1.15s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 20
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -115,7 +115,7 @@
if not post_1:
raise InvalidPostException
- if post_1[0].posted_by_id==user_id:
+ if post_1[ 1].posted_by_id==user_id:
post_1[0].delete()
if not user_1:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................F.F.............. [100%]
=================================== FAILURES ===================================
__________ test_delete_post_for_user_id_raises_invalid_user_exception __________
post = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_user_id_raises_invalid_user_exception(post):
#Arrange
#Act
with pytest.raises(InvalidUserException):
> delete_post(7,post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:356:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:118: in delete_post
if post_1[ 1].posted_by_id==user_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Post: Post object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:118: in delete_post
if post_1[ 1].posted_by_id==user_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Post: Post object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.116475) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.129959) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.188557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.190465) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.203896) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.766945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.222111) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.222952) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.224511) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.229890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.230987) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.232578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.246940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.265430) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.283675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.767055) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.303909) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.304386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.324595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.325068) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.767096) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.354246) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.354730) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.373373) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.373920) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.392333) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.392963) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.767178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.413377) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.413883) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.414414) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.433242) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.433727) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.434248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.767221) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.454047) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:16.454521) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.455009) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.455481) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.459945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.460394) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.466128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.466573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.467029) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.472895) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.473349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.477924) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.604895) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.668844) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.669331) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.676495) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.676942) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.687222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.687661) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:16.696995) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:16.697455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.767344) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.767570) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.767570) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.767726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.767726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.767726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.767880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.767880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:15.767880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:15.768031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:15.768031) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 2 failed, 45 passed, 67 warnings in 1.19s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 21
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -115,7 +115,7 @@
if not post_1:
raise InvalidPostException
- if post_1[0].posted_by_id==user_id:
+ if post_1[ -1].posted_by_id==user_id:
post_1[0].delete()
if not user_1:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................F.F.............. [100%]
=================================== FAILURES ===================================
__________ test_delete_post_for_user_id_raises_invalid_user_exception __________
post = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_user_id_raises_invalid_user_exception(post):
#Arrange
#Act
with pytest.raises(InvalidUserException):
> delete_post(7,post.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:356:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:118: in delete_post
if post_1[ -1].posted_by_id==user_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Post: Post object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:118: in delete_post
if post_1[ -1].posted_by_id==user_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Post: Post object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.942298) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.956437) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.017125) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.019157) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.033088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.591084) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.052435) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.053264) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.054880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.060403) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.061578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.063231) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.077081) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.095996) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.114764) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.591197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.135227) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.135716) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.156492) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.156985) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.591239) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.186792) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.187294) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.206034) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.206530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.224577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.225246) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.591323) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.246119) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.246595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.247121) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.267645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.268158) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.268678) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.591367) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.289945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:54.290440) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.290949) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.291445) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.296258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.296751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.303076) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.303573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.304070) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.310450) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.310949) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.315887) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.451724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.515950) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.516417) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.523647) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.524110) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.534362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.534801) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:54.543785) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:54.544225) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.591510) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.591743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.591743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.591913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.591913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.591913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.592074) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.592074) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:53.592074) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:53.592239) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:53.592239) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 2 failed, 45 passed, 67 warnings in 1.21s ===================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/NumberReplacer, occurrence: 22
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -116,7 +116,7 @@
if not post_1:
raise InvalidPostException
if post_1[0].posted_by_id==user_id:
- post_1[0].delete()
+ post_1[ 1].delete()
if not user_1:
raise InvalidUserException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.426958) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.441545) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.501807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.503789) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.517743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.068789) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.537108) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.537946) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.539503) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.545005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.546173) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.547736) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.561638) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.580456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.599371) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.068908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.620276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.620766) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.642098) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.642629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.068954) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.674144) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.674670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.694621) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.695159) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.714906) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.715567) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.069043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.735003) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.735477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.735968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.756082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.756583) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.757104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.069093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.778525) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.779024) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.779549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.780060) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.785043) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.785503) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.791814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.792306) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.792780) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.799186) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.799669) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.804576) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.814737) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.820104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.820554) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.827640) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.828073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.838082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.838526) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.847812) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.848250) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.069221) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.069438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.069438) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.069608) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.069608) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.069608) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.069777) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.069777) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.069777) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.069974) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.069974) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.03s ========================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/NumberReplacer, occurrence: 23
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -116,7 +116,7 @@
if not post_1:
raise InvalidPostException
if post_1[0].posted_by_id==user_id:
- post_1[0].delete()
+ post_1[ -1].delete()
if not user_1:
raise InvalidUserException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.464076) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.477756) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.538477) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.540494) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.554153) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.114653) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.574315) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.575216) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.576900) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.582679) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.583896) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.585593) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.600362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.620178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.639835) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.114768) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.660833) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.661335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.682478) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.682992) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.114814) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.714272) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.714811) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.734139) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.734681) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.753770) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.754459) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.114904) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.775383) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.775885) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.776414) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.797000) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.797508) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.798049) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.114953) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.819091) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.819583) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.820105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.820608) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.825507) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.826014) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.832226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.832718) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.833198) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.839290) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.839770) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.844434) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.853471) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.858890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.859335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.866233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.866673) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.876820) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.877265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.886660) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.887091) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.115086) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.115313) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.115313) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.115480) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.115480) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.115480) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.115645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.115645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:06.115645) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:06.115807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:06.115807) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 1.03s ========================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 24
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -120,7 +120,7 @@
if not user_1:
raise InvalidUserException
- if post_1[0].posted_by_id!=user_id:
+ if post_1[ 1].posted_by_id!=user_id:
raise UserCannotDeletePostException
#task 10============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ................................F.............. [100%]
=================================== FAILURES ===================================
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:123: in delete_post
if post_1[ 1].posted_by_id!=user_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Post: Post object (1)>]>, k = 1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
"Negative indexing is not supported."
if self._result_cache is not None:
> return self._result_cache[k]
E IndexError: list index out of range
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:296: IndexError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.142735) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.156144) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.215759) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.217638) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.231013) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.796721) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.249660) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.250508) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.252023) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.256352) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.257444) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.258982) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.273062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.291467) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.309805) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.796832) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.329862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.330348) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.350439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.350926) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.796880) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.380089) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.380621) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.399185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.399660) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.418416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.419060) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.796961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.439810) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.440283) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.440791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.461220) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.461708) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.462248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.797012) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.482925) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:10.483395) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.483905) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.484399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.489050) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.489498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.495167) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.495615) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.496063) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.501823) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.502304) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.506962) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.516261) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.642901) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.643353) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.650347) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.650769) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.660380) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.660785) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:10.669558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:10.669989) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.797142) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.797366) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.797366) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.797535) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.797535) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.797535) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.797705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.797705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:09.797705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:09.797870) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:09.797870) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 1 failed, 46 passed, 67 warnings in 1.12s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 25
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -120,7 +120,7 @@
if not user_1:
raise InvalidUserException
- if post_1[0].posted_by_id!=user_id:
+ if post_1[ -1].posted_by_id!=user_id:
raise UserCannotDeletePostException
#task 10============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ................................F.............. [100%]
=================================== FAILURES ===================================
_ test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception _
user = <User: User object (1)>, post2 = <Post: Post object (1)>
@pytest.mark.django_db
def test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception(user,post2):
#Arrange
#Act
with pytest.raises(UserCannotDeletePostException):
> delete_post(user.id,post2.id)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:374:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fb_post/utils.py:123: in delete_post
if post_1[ -1].posted_by_id!=user_id:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <QuerySet [<Post: Post object (1)>]>, k = -1
def __getitem__(self, k):
"""Retrieve an item or slice from the set of results."""
if not isinstance(k, (int, slice)):
raise TypeError(
'QuerySet indices must be integers or slices, not %s.'
% type(k).__name__
)
assert ((not isinstance(k, slice) and (k >= 0)) or
(isinstance(k, slice) and (k.start is None or k.start >= 0) and
(k.stop is None or k.stop >= 0))), \
> "Negative indexing is not supported."
E AssertionError: Negative indexing is not supported.
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/query.py:293: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.556262) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.569460) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.629824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.631787) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.645585) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.217324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.664832) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.665650) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.667239) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.672694) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.673825) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.675405) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.688464) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.706799) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.725821) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.217441) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.746341) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.746850) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.767842) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.768351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.217486) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.798423) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.798903) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.817556) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.818052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.836326) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.836936) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.217574) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.857660) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.858180) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.858708) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.879956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.880475) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.881008) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.217622) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.903027) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.903545) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.904093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.904603) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.909472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.909960) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.916251) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.916745) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.917224) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.923201) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.923637) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.928149) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.937467) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.060248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.060722) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.067810) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.068242) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.078503) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.078933) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:13.087985) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:13.088412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.217758) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.218001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.218001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.218163) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.218163) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.218163) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.218323) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.218323) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:12.218323) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:12.218479) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:12.218479) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
================== 1 failed, 46 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 26
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -176,7 +176,7 @@
"name": reply.commented_by.name,
"profile_pic": reply.commented_by.profile_pic
},
- "commented_at": str(reply.commented_at)[:-6],
+ "commented_at": str(reply.commented_at)[:- 7],
"comment_content": reply.content,
"reactions": {
"count": reply.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..........................................F.F.. [100%]
=================================== FAILURES ===================================
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:07.230321', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:07.230321', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:39:07.230485', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:39:07.230485', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.584566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.598341) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.659296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.661278) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.675619) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.229492) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.696011) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.696868) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.698532) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.704242) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.705408) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.707048) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.720382) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.738106) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.757270) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.229599) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.778160) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.778648) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.799767) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.800274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.229654) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.830944) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.831452) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.850280) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.850786) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.869334) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.869938) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.229743) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.890073) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.890530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.891019) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.910580) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.911039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.911533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.229791) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.931696) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.932182) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.932696) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.933185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.937984) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.938440) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.944213) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.944660) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.945105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.950863) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.951324) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.955945) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.965753) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.970953) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.971384) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.978313) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.978741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.988216) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.988610) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.997341) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.997768) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.229940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.230158) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.230158) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.230321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.230321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.230321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.230485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.230485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.230485) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.230651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.230651) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 2 failed, 45 passed, 67 warnings in 1.15s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 27
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -176,7 +176,7 @@
"name": reply.commented_by.name,
"profile_pic": reply.commented_by.profile_pic
},
- "commented_at": str(reply.commented_at)[:-6],
+ "commented_at": str(reply.commented_at)[:- 5],
"comment_content": reply.content,
"reactions": {
"count": reply.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp20zuyedj/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..........................................F.F.. [100%]
=================================== FAILURES ===================================
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:56.713866', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:56.713866', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:56.714045', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:56.714045', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.059256) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.073923) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.134978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.136943) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.151105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.713052) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.171558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.172424) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.174142) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.179912) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.181070) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.182655) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.196727) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.215576) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.234599) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.713151) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.254955) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.255448) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.276293) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.276807) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.713202) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.307281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.307803) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.326627) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.327115) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.345760) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.346386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.713281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.366635) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.367110) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.367615) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.387822) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.388298) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.388808) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.713327) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.410048) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.410530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.411056) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.411565) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.416471) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.416950) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.423128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.423615) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.424103) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.430281) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.430756) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.435531) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.445527) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.450897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.451347) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.458370) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.458775) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.468694) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.469131) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.478344) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.478781) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.713470) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.713692) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.713692) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.713866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.713866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.713866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.714045) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.714045) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:56.714045) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:56.714201) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:56.714201) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 2 failed, 45 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 28
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -192,7 +192,7 @@
"name": comment.commented_by.name,
"profile_pic": comment.commented_by.profile_pic
},
- "commented_at": str(comment.commented_at)[:-6],
+ "commented_at": str(comment.commented_at)[:- 7],
"comment_content": comment.content,
"reactions": {
"count": comment.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:41.54708', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:41.547083', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:41.54724', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:41.547245', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:41.547412', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:41.54741', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic'...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.897452) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.910883) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.969920) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.971794) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.986069) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.546459) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.004884) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.005651) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.007103) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.011233) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.012265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.013676) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.028178) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.045789) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.064263) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.546561) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.083877) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.084363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.103978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.104507) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.546611) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.134400) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.134876) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.153167) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.153626) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.172118) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.172748) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.546695) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.193284) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.193751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.194299) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.215074) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.215591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.216119) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.546739) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.237248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.237711) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.238235) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.238728) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.243471) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.243963) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.250090) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.250570) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.251054) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.257123) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.257595) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.262295) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.272040) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.277205) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.277632) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.284424) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.284836) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.294740) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.295172) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.304386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.304824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.546867) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.547083) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.547083) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.547245) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.547245) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.547245) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.547412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.547412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:41.547412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:41.547592) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:41.547592) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 29
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -192,7 +192,7 @@
"name": comment.commented_by.name,
"profile_pic": comment.commented_by.profile_pic
},
- "commented_at": str(comment.commented_at)[:-6],
+ "commented_at": str(comment.commented_at)[:- 5],
"comment_content": comment.content,
"reactions": {
"count": comment.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:57.982864+', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:57.982864', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:57.983018+', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:57.983018', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:57.983169', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:57.983169+', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pi...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.330790) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.344031) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.404091) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.405984) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.419685) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.982283) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.439253) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.440084) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.441686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.447244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.448405) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.450050) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.464330) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.483224) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.502533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.982374) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.522904) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.523389) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.544161) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.544629) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.982418) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.574232) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.574751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.594186) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.594710) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.614164) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.614826) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.982491) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.636005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.636509) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.637041) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.658082) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.658591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.659122) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.982528) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.680724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.681229) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.681751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.682268) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.687258) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.687726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.694436) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.694913) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.695384) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.701483) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.701971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.706778) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.716721) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.722018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.722447) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.729261) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.729679) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.739578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.740018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.749099) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.749530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.982647) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.982864) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.982864) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.983018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.983018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.983018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.983169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.983169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.983169) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.983316) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.983316) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.15s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 30
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -210,7 +210,7 @@
"user_id": post.posted_by_id,
"profile_pic": post.posted_by.profile_pic
},
- "posted_at": str(post.posted_at)[:-6],
+ "posted_at": str(post.posted_at)[:- 7],
"post_content": post.content,
"reactions": {
"count": post.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpr7l2basw/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................................FFF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_comments_return_empty_list _______________
user = <User: User object (1)>
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_comments_return_empty_list(user):
#Arrange
create_post(1,"happy birthday")
#Act
a=get_post(1)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'sharmila',
'user_id': 1,
'profile_pic': 'www.google.com'
},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []
},
'comments': [],
'comments_count': 0
}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-04-20 10:38:57.89698'} != {'posted_at': '2020-04-20 10:38:57.896987'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:460: AssertionError
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-04-20 10:38:57.89721'} != {'posted_at': '2020-04-20 10:38:57.897218'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-04-20 10:38:57.89738'} != {'posted_at': '2020-04-20 10:38:57.897387'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:57.89755', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:57.897558', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic'...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.247649) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.260181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.320116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.322053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.335876) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.896566) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.354906) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.355729) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.357265) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.361655) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.362757) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.364296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.378903) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.397046) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.415016) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.896679) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.434664) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.435133) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.455899) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.456414) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.896728) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.486356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.486853) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.505970) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.506454) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.524724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.525313) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.896816) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.545352) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.545810) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.546328) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.566457) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.566935) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.567427) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.896863) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.588029) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:58.588493) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.588978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.589455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.594053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.594509) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.600564) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.601044) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.601530) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.607776) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.608259) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.613088) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.622668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.627815) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.628252) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.635170) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.635591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.645205) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.645617) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:58.654689) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:58.655120) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.896987) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.897218) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.897218) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.897387) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.897387) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.897387) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.897558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.897558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:57.897558) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:57.897727) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:57.897727) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_comments_return_empty_list - A...
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 4 failed, 43 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 31
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -210,7 +210,7 @@
"user_id": post.posted_by_id,
"profile_pic": post.posted_by.profile_pic
},
- "posted_at": str(post.posted_at)[:-6],
+ "posted_at": str(post.posted_at)[:- 5],
"post_content": post.content,
"reactions": {
"count": post.reaction.count(),============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpx1jaj20f/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................................FFF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_comments_return_empty_list _______________
user = <User: User object (1)>
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_comments_return_empty_list(user):
#Arrange
create_post(1,"happy birthday")
#Act
a=get_post(1)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'sharmila',
'user_id': 1,
'profile_pic': 'www.google.com'
},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []
},
'comments': [],
'comments_count': 0
}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-04-20 10:38:43.632993+'} != {'posted_at': '2020-04-20 10:38:43.632993'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:460: AssertionError
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-04-20 10:38:43.633206+'} != {'posted_at': '2020-04-20 10:38:43.633206'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'posted_at': '2020-04-20 10:38:43.633360+'} != {'posted_at': '2020-04-20 10:38:43.633360'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:43.633514+', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:43.633514', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 1, 'replies': [{'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pi...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.977335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.990887) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.049957) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.051868) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.065572) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.632579) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.084914) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.085721) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.087320) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.092731) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.093842) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.095386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.110391) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.128830) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.147525) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.632683) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.167334) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.167795) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.186729) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.187227) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.632736) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.215906) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.216409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.234984) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.235501) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.253053) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.253741) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.632818) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.273261) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.273728) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.274257) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.292967) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.293456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.294005) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.632863) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.314834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.315310) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.315825) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.316329) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.321095) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.321567) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.327676) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.328148) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.328636) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.334730) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.335198) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.339978) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.349867) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.354686) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.355063) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.361478) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.361890) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.371971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.372413) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.381600) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.382038) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.632993) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.633206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.633206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.633360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.633360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.633360) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.633514) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.633514) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.633514) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.633666) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.633666) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_comments_return_empty_list - A...
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 4 failed, 43 passed, 67 warnings in 1.14s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 32
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -224,7 +224,7 @@
#task - 13
def get_post(post_id):
try:
- post = list(Post.objects.select_related('posted_by').prefetch_related('comments', 'reaction', 'comments__reaction','comments__commented_by').filter(id = post_id))[0]
+ post = list(Post.objects.select_related('posted_by').prefetch_related('comments', 'reaction', 'comments__reaction','comments__commented_by').filter(id = post_id))[ 1]
except:
#if not Post.objects.filter(pk = post_id).exists():
raise InvalidPostException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ........................................FFF.... [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_comments_return_empty_list _______________
post_id = 1
def get_post(post_id):
try:
> post = list(Post.objects.select_related('posted_by').prefetch_related('comments', 'reaction', 'comments__reaction','comments__commented_by').filter(id = post_id))[ 1]
E IndexError: list index out of range
fb_post/utils.py:227: IndexError
During handling of the above exception, another exception occurred:
user = <User: User object (1)>
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_comments_return_empty_list(user):
#Arrange
create_post(1,"happy birthday")
#Act
> a=get_post(1)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:458:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post_id = 1
def get_post(post_id):
try:
post = list(Post.objects.select_related('posted_by').prefetch_related('comments', 'reaction', 'comments__reaction','comments__commented_by').filter(id = post_id))[ 1]
except:
#if not Post.objects.filter(pk = post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:230: InvalidPostException
_______________ test_get_post_with_no_replies_return_empty_list ________________
post_id = 1
def get_post(post_id):
try:
> post = list(Post.objects.select_related('posted_by').prefetch_related('comments', 'reaction', 'comments__reaction','comments__commented_by').filter(id = post_id))[ 1]
E IndexError: list index out of range
fb_post/utils.py:227: IndexError
During handling of the above exception, another exception occurred:
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
> a=get_post(c)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:486:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post_id = 1
def get_post(post_id):
try:
post = list(Post.objects.select_related('posted_by').prefetch_related('comments', 'reaction', 'comments__reaction','comments__commented_by').filter(id = post_id))[ 1]
except:
#if not Post.objects.filter(pk = post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:230: InvalidPostException
______________ test_get_post_with_valid_details_return_dictionary ______________
post_id = 1
def get_post(post_id):
try:
> post = list(Post.objects.select_related('posted_by').prefetch_related('comments', 'reaction', 'comments__reaction','comments__commented_by').filter(id = post_id))[ 1]
E IndexError: list index out of range
fb_post/utils.py:227: IndexError
During handling of the above exception, another exception occurred:
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
> a=get_post(c)
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:523:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
post_id = 1
def get_post(post_id):
try:
post = list(Post.objects.select_related('posted_by').prefetch_related('comments', 'reaction', 'comments__reaction','comments__commented_by').filter(id = post_id))[ 1]
except:
#if not Post.objects.filter(pk = post_id).exists():
> raise InvalidPostException
E fb_post.exceptions.InvalidPostException
fb_post/utils.py:230: InvalidPostException
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.506631) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.520583) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.579580) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.581413) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.594930) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.154719) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.614523) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.615346) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.616914) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.622423) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.623555) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.625116) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.639905) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.658536) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.677362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.154822) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.697889) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.698405) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.719051) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.719548) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.154863) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.749578) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.750075) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.768647) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.769129) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.787915) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.788573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.154941) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.809270) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.809751) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.810283) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.831226) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.831740) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.832276) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.154985) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.853155) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.853634) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.854174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.854670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.859359) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.859824) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.865805) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.866298) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.866762) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.872702) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.873157) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.877778) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.887335) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.892371) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.892786) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.899549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.899968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.909677) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.910119) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.918927) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.919332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.155111) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.155336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.155336) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.155497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.155497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.155497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.155659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.155659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.155659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.155830) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.155830) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_comments_return_empty_list - f...
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - fb...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
================== 3 failed, 44 passed, 67 warnings in 1.14s ===================
SURVIVED
worker outcome: normal
test outcome: survived
operator: core/NumberReplacer, occurrence: 33
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -224,7 +224,7 @@
#task - 13
def get_post(post_id):
try:
- post = list(Post.objects.select_related('posted_by').prefetch_related('comments', 'reaction', 'comments__reaction','comments__commented_by').filter(id = post_id))[0]
+ post = list(Post.objects.select_related('posted_by').prefetch_related('comments', 'reaction', 'comments__reaction','comments__commented_by').filter(id = post_id))[ -1]
except:
#if not Post.objects.filter(pk = post_id).exists():
raise InvalidPostException============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmpdyrkz0jr/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................... [100%]
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.840452) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.849094) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.885510) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.886915) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.895906) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.500845) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.908472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.909048) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.910130) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.913696) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.914534) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.915570) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.924357) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.936412) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.948690) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.500956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.962456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.962780) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.975778) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.976113) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.500998) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.995343) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.995672) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.007300) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.007626) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.018985) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.019384) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.501079) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.031748) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.032105) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.032466) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.044748) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.045072) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.045419) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.501126) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.058076) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:21.058392) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.058732) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.059064) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.062118) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.062444) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.066388) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.066705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.067019) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.070899) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.071210) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.074237) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.080502) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.083837) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.084122) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.088573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.088851) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.095156) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.095441) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:21.101293) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:21.101577) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.501257) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.501483) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.501483) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.501642) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.501642) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.501642) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.501796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.501796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:20.501796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:20.501969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:20.501969) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================= 47 passed, 67 warnings in 0.76s ========================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 34
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -264,7 +264,7 @@
user_dict["name"]=i.commented_by.name
user_dict["profile_pic"]=i.commented_by.profile_pic
comment_dict["commenter"]=user_dict
- comment_dict["commented_at"]=str(i.commented_at)[:-6]
+ comment_dict["commented_at"]=str(i.commented_at)[:- 7]
comment_dict["comment_content"]=i.content
comment_list.append(comment_dict)
comment_dict={}============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmps2hjpq36/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................................F [100%]
=================================== FAILURES ===================================
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
e=reply_to_comment(d.id,b, "Thanks for ur wishes")
#Assert
> assert get_replies_for_comment(b)== [{
"comment_id": 2,
"commenter": {
"user_id": 1,
"name": "srinu",
"profile_pic": "www.facebook.com"
},
"commented_at": str(datetime.now()),
"comment_content": "Thanks for ur wishes",
}]
E AssertionError: assert [{'comment_co...user_id': 1}}] == [{'comment_co...user_id': 1}}]
E At index 0 diff: {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:37.43749', 'comment_content': 'Thanks for ur wishes'} != {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:37.437492', 'comment_content': 'Thanks for ur wishes'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:621: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.784375) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.798132) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.857396) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.859334) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.873136) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.436388) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.892058) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.892879) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.894456) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.899968) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.901112) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.902712) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.916555) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.934954) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.953319) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.436498) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.973349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.973823) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.994154) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.994648) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.436542) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.024378) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.024886) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.043342) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.043829) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.062078) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.062678) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.436631) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.082596) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.083059) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.083562) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.103199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.103665) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.104179) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.436675) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.124253) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.124716) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.125217) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.125705) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.130363) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.130828) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.136733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.137197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.137666) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.143622) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.144103) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.148772) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.158408) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.163463) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.163898) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.170601) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.171017) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.180606) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.181025) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.189950) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.190373) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.436809) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.437014) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.437014) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.437174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.437174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.437174) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.437332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.437332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.437332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.437492) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.437492) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 1 failed, 46 passed, 67 warnings in 1.08s ===================
worker outcome: normal
test outcome: killed
operator: core/NumberReplacer, occurrence: 35
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -264,7 +264,7 @@
user_dict["name"]=i.commented_by.name
user_dict["profile_pic"]=i.commented_by.profile_pic
comment_dict["commenter"]=user_dict
- comment_dict["commented_at"]=str(i.commented_at)[:-6]
+ comment_dict["commented_at"]=str(i.commented_at)[:- 5]
comment_dict["comment_content"]=i.content
comment_list.append(comment_dict)
comment_dict={}============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................................F [100%]
=================================== FAILURES ===================================
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
e=reply_to_comment(d.id,b, "Thanks for ur wishes")
#Assert
> assert get_replies_for_comment(b)== [{
"comment_id": 2,
"commenter": {
"user_id": 1,
"name": "srinu",
"profile_pic": "www.facebook.com"
},
"commented_at": str(datetime.now()),
"comment_content": "Thanks for ur wishes",
}]
E AssertionError: assert [{'comment_co...user_id': 1}}] == [{'comment_co...user_id': 1}}]
E At index 0 diff: {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:39:05.022594+', 'comment_content': 'Thanks for ur wishes'} != {'comment_id': 2, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:39:05.022594', 'comment_content': 'Thanks for ur wishes'}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:621: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.380097) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.394317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.454475) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.456395) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.470087) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.021394) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.489549) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.490405) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.492027) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.496659) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.497801) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.499396) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.514616) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.534045) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.553621) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.021509) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.575121) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.575640) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.597316) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.597827) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.021555) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.628693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.629184) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.648352) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.648854) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.667525) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.668138) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.021644) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.686471) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.686922) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.687409) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.707793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.708299) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.708825) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.021690) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.730337) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.730832) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.731356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.731869) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.736830) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.737306) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.743695) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.744199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.744674) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.750934) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.751396) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.756298) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.766334) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.771693) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.772135) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.779356) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.779798) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.790151) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.790612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.800062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.800526) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.021819) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.022068) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.022068) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.022250) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.022250) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.022250) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.022424) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.022424) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:05.022424) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:05.022594) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:05.022594) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 1 failed, 46 passed, 67 warnings in 1.11s ===================
worker outcome: normal
test outcome: killed
operator: core/ZeroIterationForLoop, occurrence: 0
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -140,7 +140,7 @@
raise InvalidUserException
reaction_1=Reaction.objects.filter(reacted_by=user_id)
post_list=[]
- for i in reaction_1:
+ for i in []:
item=i.post_id
post_list.append(item)
return post_list============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ....................................F.......... [100%]
=================================== FAILURES ===================================
_________ test_get_posts_reacted_by_user_for_valid_details_of_user_id __________
user = <User: User object (1)>, reaction2 = <Reaction: Reaction object (1)>
@pytest.mark.django_db
def test_get_posts_reacted_by_user_for_valid_details_of_user_id(user,reaction2):
#Arrange
#Act
a=get_posts_reacted_by_user(user_id=user.id)
#Assert
> assert list(a)==[1]
E assert [] == [1]
E Right contains one more item: 1
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:427: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.739649) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.753067) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.812384) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.815376) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.831665) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.399047) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.849833) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.850628) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.852192) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.857722) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.858908) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.860518) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.874443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.893293) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.912388) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.399155) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.932672) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.933160) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.953707) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.954244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.399200) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.984304) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.984813) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.003932) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.004451) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.023506) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.024147) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.399288) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.044635) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.045060) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.045527) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.065559) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.066077) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.066584) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.399334) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.087269) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:38.087739) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.088244) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.088723) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.093462) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.093964) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.100023) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.100492) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.100964) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.106959) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.107421) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.112147) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.121648) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.126937) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.127373) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.134093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.134499) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.144206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.144637) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:38.232612) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:38.233089) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.399468) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.399699) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.399699) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.399866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.399866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.399866) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.400036) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.400036) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:37.400036) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:37.400197) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:37.400197) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
================== 1 failed, 46 passed, 67 warnings in 1.09s ===================
worker outcome: normal
test outcome: killed
operator: core/ZeroIterationForLoop, occurrence: 1
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -153,7 +153,7 @@
reactions_of_post=Reaction.objects.filter(post_id=post_id)
post_list=[]
user_dict={}
- for i in reactions_of_post:
+ for i in []:
user_dict["user_id"]=i.reacted_by_id
user_dict["name"]=i.reacted_by.name
user_dict["profile_pic"]=i.reacted_by.profile_pic============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ......................................F........ [100%]
=================================== FAILURES ===================================
______________ test_get_reactions_to_post_for_valid_post_details _______________
post = <Post: Post object (1)>, reaction2 = <Reaction: Reaction object (1)>
@pytest.mark.django_db
def test_get_reactions_to_post_for_valid_post_details(post,reaction2):
#Arrange
#Act
a=get_reactions_to_post(post_id=post.id)
#Assert
> assert list(a)==[{'user_id':1,'name':'sharmila','profile_pic':'www.google.com','reaction':'LIT'}]
E AssertionError: assert [] == [{'name': 'sh...'user_id': 1}]
E Right contains one more item: {'name': 'sharmila', 'profile_pic': 'www.google.com', 'reaction': 'LIT', 'user_id': 1}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:443: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.286128) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.299788) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.359969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.361959) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.375742) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.932938) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.395139) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.395965) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.397557) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.402117) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.403212) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.404641) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.418950) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.437588) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.456074) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.933057) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.476306) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.476785) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.497243) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.497745) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.933104) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.527726) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.528238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.547021) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.547512) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.566429) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.567062) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.933193) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.587512) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.587973) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.588478) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.608670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.609148) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.609669) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.933242) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.630853) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:44.631351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.631878) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.632379) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.637288) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.637747) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.644018) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.644492) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.644965) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.651240) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.651728) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.656586) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.666563) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.671887) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.672321) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.679238) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.679671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.689785) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.690248) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:44.699517) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:44.699956) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.933371) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.933591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.933591) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.933771) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.933771) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.933771) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.933961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.933961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:43.933961) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:43.934131) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:43.934131) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details - ...
================== 1 failed, 46 passed, 67 warnings in 1.09s ===================
worker outcome: normal
test outcome: killed
operator: core/ZeroIterationForLoop, occurrence: 2
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -165,7 +165,7 @@
#task 13
def get_dict(post):
comment_list = []
- for comment in list(post.comments.all()):
+ for comment in []:
reply_list=[]
for reply in list(post.comments.all()):
if reply.parent_comment_id == comment.id:============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py .........................................FF.F.. [100%]
=================================== FAILURES ===================================
_______________ test_get_post_with_no_replies_return_empty_list ________________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_no_replies_return_empty_list():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 0,
'type': []},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions':
{'count': 0,
'type': []},
'replies_count': 0,
'replies': []}],
'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 5 identical items, use -vv to show
E Differing items:
E {'comments': []} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:19.219199', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E {'comments_count': 0} != {'comments_count': 1}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:488: AssertionError
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 5 identical items, use -vv to show
E Differing items:
E {'comments': []} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:39:19.219365', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E {'comments_count': 0} != {'comments_count': 1}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:39:19.219533', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [], 'comments_count': 0} != {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:39:19.219533', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profil...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.560723) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.573522) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.629255) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.631253) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.644805) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.218540) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.664386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.665247) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.666924) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.672641) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.673818) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.675439) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.689862) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.709190) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.728795) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.218652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.750319) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.750821) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.771667) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.772156) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.218699) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.802297) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.802842) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.822211) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.822700) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.841562) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.842218) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.218793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.862902) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.863376) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.863910) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.884399) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.884900) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.885416) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.218838) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.906482) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.906970) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.907478) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.907969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.912327) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.912754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.918499) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.918966) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.919443) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.925602) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.926095) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.930939) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.940594) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.945796) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.946247) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.953093) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.953519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.963488) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.963939) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.973077) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.973513) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.218967) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.219199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.219199) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.219365) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.219365) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.219365) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.219533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.219533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:19.219533) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:19.219688) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:19.219688) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_no_replies_return_empty_list - As...
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 3 failed, 44 passed, 67 warnings in 1.13s ===================
worker outcome: normal
test outcome: killed
operator: core/ZeroIterationForLoop, occurrence: 3
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -167,7 +167,7 @@
comment_list = []
for comment in list(post.comments.all()):
reply_list=[]
- for reply in list(post.comments.all()):
+ for reply in []:
if reply.parent_comment_id == comment.id:
replies ={
"comment_id": reply.id,============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp3drvcp0s/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..........................................F.F.. [100%]
=================================== FAILURES ===================================
______________ test_get_post_with_valid_details_return_dictionary ______________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_post_with_valid_details_return_dictionary():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_post(c)
#Assert
> assert a=={'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}
E AssertionError: assert {'comments': ...t_id': 1, ...} == {'comments': ...t_id': 1, ...}
E Omitting 6 identical items, use -vv to show
E Differing items:
E {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:42.089013', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]} != {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:42.089013', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}, ...}]}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:525: AssertionError
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [{'comments':..._id': 1, ...}] == [{'comments':..._id': 1, ...}]
E At index 0 diff: {'post_id': 1, 'posted_by': {'name': 'srinu', 'user_id': 1, 'profile_pic': 'www.facebook.com'}, 'posted_at': '2020-04-20 10:38:42.089181', 'post_content': 'happy birthday', 'reactions': {'count': 1, 'type': ['LOVE']}, 'comments': [{'comment_id': 1, 'commenter': {'user_id': 1, 'name': 'srinu', 'profile_pic': 'www.facebook.com'}, 'commented_at': '2020-04-20 10:38:42.089181', 'comment_content': 'happy day', 'reactions': {'count': 1, 'type': ['WOW']}, 'replies_count': 0, 'replies': []}], 'comments_count': 1} != {'post_id': 1, 'posted_by': {'name': 'srinu', ...
E
E ...Full output truncated (2 lines hidden), use '-vv' to show
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.429780) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.442990) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.502194) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.504049) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.517196) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.088206) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.536472) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.537296) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.538844) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.544172) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.545274) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.546785) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.560181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.578555) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.596547) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.088312) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.616422) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.616897) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.637529) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.638010) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.088362) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.669435) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.670039) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.689773) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.690328) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.709692) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.710386) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.088451) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.731841) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.732371) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.732916) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.753671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.754210) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.754738) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.088496) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.776388) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.776857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.777351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.777847) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.782519) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.782983) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.788733) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.789185) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.789644) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.795404) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.795843) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.800271) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.810027) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.814929) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.815349) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.821924) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.822348) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.831940) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.832384) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.841295) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.841712) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.088624) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.088847) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.088847) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.089013) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.089013) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.089013) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.089181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.089181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:42.089181) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:42.089351) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:42.089351) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 2 failed, 45 passed, 67 warnings in 1.09s ===================
worker outcome: normal
test outcome: killed
operator: core/ZeroIterationForLoop, occurrence: 4
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -245,7 +245,7 @@
if not User.objects.filter(pk = user_id).exists():
raise InvalidUserException
res_list = []
- for p in post:
+ for p in []:
res_list.append(get_dict(p))
return res_list
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp2u935d66/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ............................................F.. [100%]
=================================== FAILURES ===================================
________ test_get_user_posts_with_valid_details_return_list_of_post_ids ________
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_user_posts_with_valid_details_return_list_of_post_ids():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
e=reply_to_comment(d.id,b, "thanks for ur wishes")
react_to_post(d.id, c, "LOVE")
react_to_comment(d.id, b, "WOW")
#Act
a=get_user_posts(d.id)
#Assert
> assert list(a)==[{'post_id': 1,
'posted_by': {
'name': 'srinu',
'user_id': 1,
'profile_pic': 'www.facebook.com'},
'posted_at': str(datetime.now()),
'post_content': 'happy birthday',
'reactions': {
'count': 1,
'type': ['LOVE']},
'comments': [{
'comment_id': 1,
'commenter': {
'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'happy day',
'reactions': {'count': 1,
'type': ['WOW']},
'replies_count': 1,
'replies': [{'comment_id': 2,
'commenter': {'user_id': 1,
'name': 'srinu',
'profile_pic': 'www.facebook.com'},
'commented_at': str(datetime.now()),
'comment_content': 'thanks for ur wishes',
'reactions': {'count': 0, 'type': []}}]}], 'comments_count': 1}]
E AssertionError: assert [] == [{'comments':..._id': 1, ...}]
E Right contains one more item: {'comments': [{'comment_content': 'happy day', 'comment_id': 1, 'commented_at': '2020-04-20 10:38:39.467670', 'comment...c': 'www.facebook.com', 'user_id': 1}, ...}], 'comments_count': 1, 'post_content': 'happy birthday', 'post_id': 1, ...}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:574: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.821574) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.836329) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.898037) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.899939) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.913592) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.466687) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.933616) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.934505) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.936102) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.940575) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.941668) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.943249) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.958771) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.977657) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.996895) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.466804) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.017784) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.018277) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.038825) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.039315) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.466848) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.068962) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.069484) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.088170) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.088666) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.107317) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.107933) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.466935) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.128247) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.128712) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.129220) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.149304) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.149789) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.150309) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.466985) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.170652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:40.171106) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.171588) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.172059) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.176713) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.177188) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.183172) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.183625) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.184101) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.189860) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.190332) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.194947) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.204478) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.209447) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.209857) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.216573) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.216986) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.226724) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.227131) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:40.235969) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:40.236397) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.467119) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.467348) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.467348) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.467508) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.467508) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.467508) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.467670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.467670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:38:39.467670) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:38:39.467834) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:38:39.467834) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
================== 1 failed, 46 passed, 67 warnings in 1.11s ===================
worker outcome: normal
test outcome: killed
operator: core/ZeroIterationForLoop, occurrence: 5
--- mutation diff ---
--- afb_post/utils.py
+++ bfb_post/utils.py
@@ -258,7 +258,7 @@
comment_dict={}
comment_list=[]
user_dict={}
- for i in about_comment:
+ for i in []:
comment_dict["comment_id"]=i.id
user_dict["user_id"]=i.commented_by.id
user_dict["name"]=i.commented_by.name============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
django: settings: testing_assignment_004.settings (from ini)
rootdir: /tmp/tmp1a9f8hkf/repo, inifile: pytest.ini
plugins: django-3.8.0, timeout-1.3.4, parallel-0.0.10, cov-2.8.1, pythonpath-0.7.3
collected 47 items
fb_post/tests.py ..............................................F [100%]
=================================== FAILURES ===================================
___ test_get_replies_for_comment_with_valid_details_return_comment_and_user ____
@freeze_time(str(datetime.now()))
@pytest.mark.django_db
def test_get_replies_for_comment_with_valid_details_return_comment_and_user():
#Arrange
d=User.objects.create(name="srinu",profile_pic="www.facebook.com")
c=create_post(d.id,"happy birthday")
b=create_comment(d.id,c,"happy day")
#Act
e=reply_to_comment(d.id,b, "Thanks for ur wishes")
#Assert
> assert get_replies_for_comment(b)== [{
"comment_id": 2,
"commenter": {
"user_id": 1,
"name": "srinu",
"profile_pic": "www.facebook.com"
},
"commented_at": str(datetime.now()),
"comment_content": "Thanks for ur wishes",
}]
E AssertionError: assert [] == [{'comment_co...user_id': 1}}]
E Right contains one more item: {'comment_content': 'Thanks for ur wishes', 'comment_id': 2, 'commented_at': '2020-04-20 10:39:07.503175', 'commenter': {'name': 'srinu', 'profile_pic': 'www.facebook.com', 'user_id': 1}}
E Use -v to get the full diff
/home/ubuntu/assignment_submissions/testing/testing_assignment_004/ab75c10e394244e8ae61550268480404/testing_assignment_004/fb_post/tests.py:621: AssertionError
=============================== warnings summary ===============================
fb_post/tests.py::test_create_post_valid_user_id_and_post_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.849836) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_content_raises_invalid_comment_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.862830) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.921459) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_create_comment_valid_user_post_ids_and_comment_content
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.923291) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.936752) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_comment_content_raises_invalid_reply_content_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.502023) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.955971) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.956740) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_without_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.958310) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.963855) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.964979) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_reply_to_comment_valid_user_comment_ids_and_reply_comment_with_parent_comment_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.966574) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.980222) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.998681) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.016712) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.502130) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.036049) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.036497) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.056246) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.056715) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_post_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.502172) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.086793) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_empty_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.087291) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.106674) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_reaction_type_raises_invalid_reaction_type_exception_with_different_field
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.107164) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.126474) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.127107) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_first_time
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.502254) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.148011) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.148480) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_already_existed_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.148987) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.169266) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.169750) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.170270) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_react_to_comment_valid_reaction_type_for_the_second_time_with_different_reaction
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.502299) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.190967) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:08.191444) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.191958) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_total_reaction_count_of_reactions_count
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.192455) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.197010) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.197436) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.203394) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.203855) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_more_than_one
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.204302) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.210268) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reaction_metrics_for_given_post_id_raises_invalid_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.210718) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_user_id_raises_invalid_user_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.215330) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_delete_post_for_post_id_not_equal_to_user_id_raises_cannot_delete_post_exception
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.224754) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.229671) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_more_positive_reactions_returns_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.230090) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.236782) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_with_negative_reactions_returns_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.237204) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.246778) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_posts_reacted_by_user_for_valid_details_of_user_id
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.247186) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:08.255948) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_reactions_to_post_for_valid_post_details
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:08.256361) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_comments_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.502424) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.502652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_no_replies_return_empty_list
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.502652) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.502826) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.502826) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_post_with_valid_details_return_dictionary
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.502826) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.503001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.503001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_user_posts_with_valid_details_return_list_of_post_ids
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Reaction.reacted_at received a naive datetime (2020-04-20 10:39:07.503001) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Post.posted_at received a naive datetime (2020-04-20 10:39:07.503175) while time zone support is active.
RuntimeWarning)
fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
/home/ubuntu/.venv/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1368: RuntimeWarning: DateTimeField Comment.commented_at received a naive datetime (2020-04-20 10:39:07.503175) while time zone support is active.
RuntimeWarning)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
FAILED fb_post/tests.py::test_get_replies_for_comment_with_valid_details_return_comment_and_user
================== 1 failed, 46 passed, 67 warnings in 1.09s ===================